dry-graphql 0.2.3 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +10 -15
- data/.travis.yml +3 -3
- data/Appraisals +4 -4
- data/Gemfile +1 -0
- data/README.md +2 -3
- data/dry-graphql.gemspec +4 -3
- data/gemfiles/{dry_struct_4.gemfile → dry_struct_1.0.gemfile} +2 -1
- data/gemfiles/dry_struct_1.0.gemfile.lock +119 -0
- data/gemfiles/{dry_struct_5.gemfile → dry_struct_1.1.gemfile} +2 -1
- data/gemfiles/dry_struct_1.1.gemfile.lock +119 -0
- data/lib/dry/graphql.rb +7 -3
- data/lib/dry/graphql/rom.rb +10 -1
- data/lib/dry/graphql/schema_builder.rb +11 -6
- data/lib/dry/graphql/version.rb +1 -1
- metadata +18 -17
- data/gemfiles/dry_struct_4.gemfile.lock +0 -97
- data/gemfiles/dry_struct_5.gemfile.lock +0 -97
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2b4ae0bbab1f0b88ed3712d604b14a1c1cd151a66d468be7898e6a3cf37448e
|
4
|
+
data.tar.gz: 283034f0d3e05ff07da659e50d28392257ef28ef3dac9e60a47d70008ffa925a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb144122f8cd3679892b2f9646cc6215d1251d8fbdc7e2c592f0eaf9522a95cd71cd88db2fafacd5fb23ed1e09bd3ea88849f02559095d2aba01940aa3bdbf6d
|
7
|
+
data.tar.gz: ec41cc3fd1c59e71bc1f203b712caba770c528e9d4eb4cfca8018300e2eca74b878c119daee0d76294cd5c3e3ce09288f4e0fedf6d20b40fd717a91dd8b7807f
|
data/.rubocop_todo.yml
CHANGED
@@ -1,34 +1,28 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2019-
|
3
|
+
# on 2019-10-21 16:52:46 -0400 using RuboCop version 0.75.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count: 2
|
10
|
-
Metrics/AbcSize:
|
11
|
-
Max: 41
|
12
|
-
|
13
9
|
# Offense count: 3
|
14
|
-
|
15
|
-
|
16
|
-
Metrics/BlockLength:
|
17
|
-
Max: 114
|
10
|
+
Metrics/AbcSize:
|
11
|
+
Max: 44
|
18
12
|
|
19
13
|
# Offense count: 1
|
20
14
|
# Configuration parameters: CountComments.
|
21
15
|
Metrics/ClassLength:
|
22
|
-
Max:
|
16
|
+
Max: 151
|
23
17
|
|
24
18
|
# Offense count: 2
|
25
19
|
Metrics/CyclomaticComplexity:
|
26
20
|
Max: 14
|
27
21
|
|
28
|
-
# Offense count:
|
22
|
+
# Offense count: 2
|
29
23
|
# Configuration parameters: CountComments, ExcludedMethods.
|
30
24
|
Metrics/MethodLength:
|
31
|
-
Max:
|
25
|
+
Max: 12
|
32
26
|
|
33
27
|
# Offense count: 1
|
34
28
|
# Configuration parameters: ExpectMatchingDefinition, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
@@ -37,8 +31,9 @@ Naming/FileName:
|
|
37
31
|
Exclude:
|
38
32
|
- 'lib/dry-graphql.rb'
|
39
33
|
|
40
|
-
# Offense count:
|
41
|
-
#
|
34
|
+
# Offense count: 17
|
35
|
+
# Cop supports --auto-correct.
|
36
|
+
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
42
37
|
# URISchemes: http, https
|
43
38
|
Metrics/LineLength:
|
44
|
-
Max:
|
39
|
+
Max: 105
|
data/.travis.yml
CHANGED
@@ -3,11 +3,11 @@ sudo: false
|
|
3
3
|
language: ruby
|
4
4
|
cache: bundler
|
5
5
|
gemfile:
|
6
|
-
- gemfiles/
|
7
|
-
- gemfiles/
|
6
|
+
- gemfiles/dry_struct_1.0.gemfile
|
7
|
+
- gemfiles/dry_struct_1.1.gemfile
|
8
8
|
script:
|
9
9
|
- bundle exec rubocop
|
10
10
|
- bundle exec rspec
|
11
11
|
rvm:
|
12
|
-
- 2.5.
|
12
|
+
- 2.5.7
|
13
13
|
before_install: gem install bundler -v 1.16.5
|
data/Appraisals
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
appraise 'dry-struct-
|
4
|
-
gem 'dry-struct', '~> 0.
|
3
|
+
appraise 'dry-struct-1.0' do
|
4
|
+
gem 'dry-struct', '~> 1.0.0'
|
5
5
|
end
|
6
6
|
|
7
|
-
appraise 'dry-struct-
|
8
|
-
gem 'dry-struct', '~>
|
7
|
+
appraise 'dry-struct-1.1' do
|
8
|
+
gem 'dry-struct', '~> 1.1.0'
|
9
9
|
end
|
10
10
|
|
11
11
|
# vi: ft=ruby
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# Dry::GraphQL
|
2
|
+
|
2
3
|
[![Build Status](https://travis-ci.org/adHawk/dry-graphql.svg?branch=master)](https://travis-ci.org/adHawk/dry-graphql)
|
3
4
|
|
4
5
|
`dry-graphql` makes [dry-types](https://dry-rb.org/gems/dry-types/) and
|
@@ -15,7 +16,7 @@ Here is an example of using it with `dry-struct`:
|
|
15
16
|
```ruby
|
16
17
|
class User < Dry::Struct
|
17
18
|
module Types
|
18
|
-
include Dry
|
19
|
+
include Dry.Types()
|
19
20
|
end
|
20
21
|
|
21
22
|
attribute :name, Types::Strict::String.optional
|
@@ -51,7 +52,6 @@ end
|
|
51
52
|
|
52
53
|
To add a `graphql_type` method to a `ROM::Relation`:
|
53
54
|
|
54
|
-
|
55
55
|
```ruby
|
56
56
|
require 'dry/graphql/rom'
|
57
57
|
|
@@ -76,7 +76,6 @@ Or install it yourself as:
|
|
76
76
|
|
77
77
|
$ gem install dry-graphql
|
78
78
|
|
79
|
-
|
80
79
|
## Development
|
81
80
|
|
82
81
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
data/dry-graphql.gemspec
CHANGED
@@ -32,9 +32,10 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.bindir = 'exe'
|
33
33
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
34
34
|
spec.require_paths = ['lib']
|
35
|
-
|
36
|
-
spec.add_runtime_dependency 'dry-
|
37
|
-
spec.add_runtime_dependency '
|
35
|
+
|
36
|
+
spec.add_runtime_dependency 'dry-struct', '~> 1.0'
|
37
|
+
spec.add_runtime_dependency 'dry-types', '~> 1.1.1'
|
38
|
+
spec.add_runtime_dependency 'graphql', '~> 1.9.0'
|
38
39
|
|
39
40
|
spec.add_development_dependency 'appraisal'
|
40
41
|
spec.add_development_dependency 'bundler', '~> 1.16'
|
@@ -0,0 +1,119 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
dry-graphql (2.0.0)
|
5
|
+
dry-struct (~> 1.0)
|
6
|
+
dry-types (~> 1.1.1)
|
7
|
+
graphql (~> 1.9.0)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
appraisal (2.2.0)
|
13
|
+
bundler
|
14
|
+
rake
|
15
|
+
thor (>= 0.14.0)
|
16
|
+
ast (2.4.0)
|
17
|
+
backport (0.3.0)
|
18
|
+
coderay (1.1.2)
|
19
|
+
concurrent-ruby (1.1.5)
|
20
|
+
diff-lcs (1.3)
|
21
|
+
dry-configurable (0.8.3)
|
22
|
+
concurrent-ruby (~> 1.0)
|
23
|
+
dry-core (~> 0.4, >= 0.4.7)
|
24
|
+
dry-container (0.7.2)
|
25
|
+
concurrent-ruby (~> 1.0)
|
26
|
+
dry-configurable (~> 0.1, >= 0.1.3)
|
27
|
+
dry-core (0.4.9)
|
28
|
+
concurrent-ruby (~> 1.0)
|
29
|
+
dry-equalizer (0.2.2)
|
30
|
+
dry-inflector (0.2.0)
|
31
|
+
dry-logic (1.0.3)
|
32
|
+
concurrent-ruby (~> 1.0)
|
33
|
+
dry-core (~> 0.2)
|
34
|
+
dry-equalizer (~> 0.2)
|
35
|
+
dry-struct (1.0.0)
|
36
|
+
dry-core (~> 0.4, >= 0.4.3)
|
37
|
+
dry-equalizer (~> 0.2)
|
38
|
+
dry-types (~> 1.0)
|
39
|
+
ice_nine (~> 0.11)
|
40
|
+
dry-types (1.1.1)
|
41
|
+
concurrent-ruby (~> 1.0)
|
42
|
+
dry-container (~> 0.3)
|
43
|
+
dry-core (~> 0.4, >= 0.4.4)
|
44
|
+
dry-equalizer (~> 0.2, >= 0.2.2)
|
45
|
+
dry-inflector (~> 0.1, >= 0.1.2)
|
46
|
+
dry-logic (~> 1.0, >= 1.0.2)
|
47
|
+
graphql (1.9.14)
|
48
|
+
htmlentities (4.3.4)
|
49
|
+
ice_nine (0.11.2)
|
50
|
+
jaro_winkler (1.5.3)
|
51
|
+
kramdown (1.17.0)
|
52
|
+
method_source (0.9.2)
|
53
|
+
mini_portile2 (2.4.0)
|
54
|
+
nokogiri (1.10.4)
|
55
|
+
mini_portile2 (~> 2.4.0)
|
56
|
+
parallel (1.18.0)
|
57
|
+
parser (2.6.5.0)
|
58
|
+
ast (~> 2.4.0)
|
59
|
+
pry (0.12.2)
|
60
|
+
coderay (~> 1.1.0)
|
61
|
+
method_source (~> 0.9.0)
|
62
|
+
rainbow (3.0.0)
|
63
|
+
rake (10.5.0)
|
64
|
+
reverse_markdown (1.3.0)
|
65
|
+
nokogiri
|
66
|
+
rspec (3.9.0)
|
67
|
+
rspec-core (~> 3.9.0)
|
68
|
+
rspec-expectations (~> 3.9.0)
|
69
|
+
rspec-mocks (~> 3.9.0)
|
70
|
+
rspec-core (3.9.0)
|
71
|
+
rspec-support (~> 3.9.0)
|
72
|
+
rspec-expectations (3.9.0)
|
73
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
74
|
+
rspec-support (~> 3.9.0)
|
75
|
+
rspec-mocks (3.9.0)
|
76
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
77
|
+
rspec-support (~> 3.9.0)
|
78
|
+
rspec-support (3.9.0)
|
79
|
+
rubocop (0.75.1)
|
80
|
+
jaro_winkler (~> 1.5.1)
|
81
|
+
parallel (~> 1.10)
|
82
|
+
parser (>= 2.6)
|
83
|
+
rainbow (>= 2.2.2, < 4.0)
|
84
|
+
ruby-progressbar (~> 1.7)
|
85
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
86
|
+
ruby-progressbar (1.10.1)
|
87
|
+
solargraph (0.31.3)
|
88
|
+
backport (~> 0.3)
|
89
|
+
htmlentities (~> 4.3, >= 4.3.4)
|
90
|
+
jaro_winkler (~> 1.5)
|
91
|
+
kramdown (~> 1.16)
|
92
|
+
parser (~> 2.3)
|
93
|
+
reverse_markdown (~> 1.0, >= 1.0.5)
|
94
|
+
rubocop (~> 0.52)
|
95
|
+
thor (~> 0.19, >= 0.19.4)
|
96
|
+
tilt (~> 2.0)
|
97
|
+
yard (~> 0.9)
|
98
|
+
thor (0.20.3)
|
99
|
+
tilt (2.0.10)
|
100
|
+
unicode-display_width (1.6.0)
|
101
|
+
yard (0.9.20)
|
102
|
+
|
103
|
+
PLATFORMS
|
104
|
+
ruby
|
105
|
+
|
106
|
+
DEPENDENCIES
|
107
|
+
appraisal
|
108
|
+
bundler (~> 1.16)
|
109
|
+
dry-graphql!
|
110
|
+
dry-struct (~> 1.0.0)
|
111
|
+
graphql
|
112
|
+
pry
|
113
|
+
rake (~> 10.0)
|
114
|
+
rspec (~> 3.0)
|
115
|
+
rubocop
|
116
|
+
solargraph
|
117
|
+
|
118
|
+
BUNDLED WITH
|
119
|
+
1.17.1
|
@@ -0,0 +1,119 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ..
|
3
|
+
specs:
|
4
|
+
dry-graphql (2.0.0)
|
5
|
+
dry-struct (~> 1.0)
|
6
|
+
dry-types (~> 1.1.1)
|
7
|
+
graphql (~> 1.9.0)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
appraisal (2.2.0)
|
13
|
+
bundler
|
14
|
+
rake
|
15
|
+
thor (>= 0.14.0)
|
16
|
+
ast (2.4.0)
|
17
|
+
backport (0.3.0)
|
18
|
+
coderay (1.1.2)
|
19
|
+
concurrent-ruby (1.1.5)
|
20
|
+
diff-lcs (1.3)
|
21
|
+
dry-configurable (0.8.3)
|
22
|
+
concurrent-ruby (~> 1.0)
|
23
|
+
dry-core (~> 0.4, >= 0.4.7)
|
24
|
+
dry-container (0.7.2)
|
25
|
+
concurrent-ruby (~> 1.0)
|
26
|
+
dry-configurable (~> 0.1, >= 0.1.3)
|
27
|
+
dry-core (0.4.9)
|
28
|
+
concurrent-ruby (~> 1.0)
|
29
|
+
dry-equalizer (0.2.2)
|
30
|
+
dry-inflector (0.2.0)
|
31
|
+
dry-logic (1.0.3)
|
32
|
+
concurrent-ruby (~> 1.0)
|
33
|
+
dry-core (~> 0.2)
|
34
|
+
dry-equalizer (~> 0.2)
|
35
|
+
dry-struct (1.1.0)
|
36
|
+
dry-core (~> 0.4, >= 0.4.3)
|
37
|
+
dry-equalizer (~> 0.2)
|
38
|
+
dry-types (~> 1.0)
|
39
|
+
ice_nine (~> 0.11)
|
40
|
+
dry-types (1.1.1)
|
41
|
+
concurrent-ruby (~> 1.0)
|
42
|
+
dry-container (~> 0.3)
|
43
|
+
dry-core (~> 0.4, >= 0.4.4)
|
44
|
+
dry-equalizer (~> 0.2, >= 0.2.2)
|
45
|
+
dry-inflector (~> 0.1, >= 0.1.2)
|
46
|
+
dry-logic (~> 1.0, >= 1.0.2)
|
47
|
+
graphql (1.9.14)
|
48
|
+
htmlentities (4.3.4)
|
49
|
+
ice_nine (0.11.2)
|
50
|
+
jaro_winkler (1.5.3)
|
51
|
+
kramdown (1.17.0)
|
52
|
+
method_source (0.9.2)
|
53
|
+
mini_portile2 (2.4.0)
|
54
|
+
nokogiri (1.10.4)
|
55
|
+
mini_portile2 (~> 2.4.0)
|
56
|
+
parallel (1.18.0)
|
57
|
+
parser (2.6.5.0)
|
58
|
+
ast (~> 2.4.0)
|
59
|
+
pry (0.12.2)
|
60
|
+
coderay (~> 1.1.0)
|
61
|
+
method_source (~> 0.9.0)
|
62
|
+
rainbow (3.0.0)
|
63
|
+
rake (10.5.0)
|
64
|
+
reverse_markdown (1.3.0)
|
65
|
+
nokogiri
|
66
|
+
rspec (3.9.0)
|
67
|
+
rspec-core (~> 3.9.0)
|
68
|
+
rspec-expectations (~> 3.9.0)
|
69
|
+
rspec-mocks (~> 3.9.0)
|
70
|
+
rspec-core (3.9.0)
|
71
|
+
rspec-support (~> 3.9.0)
|
72
|
+
rspec-expectations (3.9.0)
|
73
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
74
|
+
rspec-support (~> 3.9.0)
|
75
|
+
rspec-mocks (3.9.0)
|
76
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
77
|
+
rspec-support (~> 3.9.0)
|
78
|
+
rspec-support (3.9.0)
|
79
|
+
rubocop (0.75.1)
|
80
|
+
jaro_winkler (~> 1.5.1)
|
81
|
+
parallel (~> 1.10)
|
82
|
+
parser (>= 2.6)
|
83
|
+
rainbow (>= 2.2.2, < 4.0)
|
84
|
+
ruby-progressbar (~> 1.7)
|
85
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
86
|
+
ruby-progressbar (1.10.1)
|
87
|
+
solargraph (0.31.3)
|
88
|
+
backport (~> 0.3)
|
89
|
+
htmlentities (~> 4.3, >= 4.3.4)
|
90
|
+
jaro_winkler (~> 1.5)
|
91
|
+
kramdown (~> 1.16)
|
92
|
+
parser (~> 2.3)
|
93
|
+
reverse_markdown (~> 1.0, >= 1.0.5)
|
94
|
+
rubocop (~> 0.52)
|
95
|
+
thor (~> 0.19, >= 0.19.4)
|
96
|
+
tilt (~> 2.0)
|
97
|
+
yard (~> 0.9)
|
98
|
+
thor (0.20.3)
|
99
|
+
tilt (2.0.10)
|
100
|
+
unicode-display_width (1.6.0)
|
101
|
+
yard (0.9.20)
|
102
|
+
|
103
|
+
PLATFORMS
|
104
|
+
ruby
|
105
|
+
|
106
|
+
DEPENDENCIES
|
107
|
+
appraisal
|
108
|
+
bundler (~> 1.16)
|
109
|
+
dry-graphql!
|
110
|
+
dry-struct (~> 1.1.0)
|
111
|
+
graphql
|
112
|
+
pry
|
113
|
+
rake (~> 10.0)
|
114
|
+
rspec (~> 3.0)
|
115
|
+
rubocop
|
116
|
+
solargraph
|
117
|
+
|
118
|
+
BUNDLED WITH
|
119
|
+
1.17.1
|
data/lib/dry/graphql.rb
CHANGED
@@ -15,14 +15,18 @@ module Dry
|
|
15
15
|
graphql_name = name.to_s.gsub('::', '__')
|
16
16
|
graphql_schema = SchemaBuilder.build_graphql_schema_class(name)
|
17
17
|
graphql_schema.graphql_name(name)
|
18
|
-
|
18
|
+
schema_hash = schema.each_with_object({}) do |type, memo|
|
19
|
+
memo[type.name] = type.type
|
20
|
+
end
|
21
|
+
|
22
|
+
opts = { name: graphql_name, type: schema_hash, schema: graphql_schema, options: options }
|
19
23
|
@graphql_type ||= SchemaBuilder.new(opts).graphql_type
|
20
24
|
end
|
21
25
|
end
|
22
26
|
|
23
27
|
class << self
|
24
|
-
def from(type, name:, **opts)
|
25
|
-
SchemaBuilder.new(name: name, type: type, options: opts).graphql_type
|
28
|
+
def from(type, name:, schema:, **opts)
|
29
|
+
SchemaBuilder.new(name: name, type: type, schema: schema, options: opts).graphql_type
|
26
30
|
end
|
27
31
|
|
28
32
|
def register_type_mapping(input_type, output_type)
|
data/lib/dry/graphql/rom.rb
CHANGED
@@ -16,8 +16,17 @@ module Dry
|
|
16
16
|
return @graphql_type if @graphql_type
|
17
17
|
|
18
18
|
base_schema = schema.to_output_hash
|
19
|
+
|
20
|
+
schema_hash = base_schema.each_with_object({}) do |type, memo|
|
21
|
+
memo[type.name] = type.type
|
22
|
+
end
|
23
|
+
|
19
24
|
type_name = Dry::Core::Inflector.singularize(name)
|
20
|
-
|
25
|
+
graphql_name = type_name.to_s.gsub('::', '__')
|
26
|
+
graphql_schema = SchemaBuilder.build_graphql_schema_class(graphql_name)
|
27
|
+
graphql_schema.graphql_name(graphql_name)
|
28
|
+
|
29
|
+
@graphql_type ||= Dry::GraphQL.from(schema_hash, name: type_name, schema: graphql_schema, **opts)
|
21
30
|
end
|
22
31
|
end
|
23
32
|
end
|
@@ -64,7 +64,10 @@ module Dry
|
|
64
64
|
when primitive?
|
65
65
|
TypeMappings.map_type(type.primitive)
|
66
66
|
when hash_schema?
|
67
|
-
|
67
|
+
schema_hash = type.options[:keys].each_with_object({}) do |type, hash|
|
68
|
+
hash[type.name] = type.type
|
69
|
+
end
|
70
|
+
map_hash schema_hash
|
68
71
|
when raw_hash_type?
|
69
72
|
# FIXME: this should be configurable
|
70
73
|
::Dry::GraphQL::Types::JSON
|
@@ -72,16 +75,16 @@ module Dry
|
|
72
75
|
map_array type
|
73
76
|
when ::Hash
|
74
77
|
map_hash type
|
75
|
-
when schema?
|
76
|
-
map_schema type
|
77
78
|
when ::Dry::Types::Hash
|
78
79
|
schema
|
79
80
|
when ::Dry::Types::Constrained, Dry::Types::Constructor
|
80
81
|
reduce_with type: type.type
|
81
82
|
when ::Dry::Types::Sum::Constrained, ::Dry::Types::Sum
|
82
83
|
reduce_with type: type.right
|
83
|
-
when ::Dry::Types::
|
84
|
+
when ::Dry::Types::Nominal
|
84
85
|
reduce_with type: type.primitive
|
86
|
+
when schema?
|
87
|
+
map_schema type
|
85
88
|
else
|
86
89
|
raise_type_mapping_error(type)
|
87
90
|
end
|
@@ -112,7 +115,7 @@ module Dry
|
|
112
115
|
end
|
113
116
|
|
114
117
|
def hash_schema?
|
115
|
-
->(type) { type.respond_to?(:options) && type.options.key?(:
|
118
|
+
->(type) { type.respond_to?(:options) && type.options.key?(:keys) }
|
116
119
|
end
|
117
120
|
|
118
121
|
def specified_in_meta?
|
@@ -120,7 +123,7 @@ module Dry
|
|
120
123
|
end
|
121
124
|
|
122
125
|
def raw_hash_type?
|
123
|
-
->(type) { type.is_a?(Dry::Types::Hash) && !type.options.key(:
|
126
|
+
->(type) { type.is_a?(Dry::Types::Hash) && !type.options.key(:keys) }
|
124
127
|
end
|
125
128
|
|
126
129
|
def pkey_or_fkey?
|
@@ -166,6 +169,8 @@ module Dry
|
|
166
169
|
graphql_schema.graphql_name
|
167
170
|
type_to_map = if type.respond_to?(:schema) && type.method(:schema).arity.zero?
|
168
171
|
type.schema
|
172
|
+
elsif type.respond_to?(:attributes)
|
173
|
+
type.schema
|
169
174
|
else
|
170
175
|
type.type
|
171
176
|
end
|
data/lib/dry/graphql/version.rb
CHANGED
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-graphql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Ker-Seymer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-struct
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: dry-types
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.1.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.1.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: graphql
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 1.9.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 1.9.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: appraisal
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,10 +130,10 @@ files:
|
|
130
130
|
- bin/setup
|
131
131
|
- dry-graphql.gemspec
|
132
132
|
- gemfiles/.bundle/config
|
133
|
-
- gemfiles/
|
134
|
-
- gemfiles/
|
135
|
-
- gemfiles/
|
136
|
-
- gemfiles/
|
133
|
+
- gemfiles/dry_struct_1.0.gemfile
|
134
|
+
- gemfiles/dry_struct_1.0.gemfile.lock
|
135
|
+
- gemfiles/dry_struct_1.1.gemfile
|
136
|
+
- gemfiles/dry_struct_1.1.gemfile.lock
|
137
137
|
- lib/dry-graphql.rb
|
138
138
|
- lib/dry/graphql.rb
|
139
139
|
- lib/dry/graphql/base_object.rb
|
@@ -161,7 +161,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: '0'
|
163
163
|
requirements: []
|
164
|
-
|
164
|
+
rubyforge_project:
|
165
|
+
rubygems_version: 2.7.8
|
165
166
|
signing_key:
|
166
167
|
specification_version: 4
|
167
168
|
summary: Integrate dry-types/dry-struct with graphql-ruby
|
@@ -1,97 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ..
|
3
|
-
specs:
|
4
|
-
dry-graphql (0.1.0)
|
5
|
-
dry-struct (>= 0.4.0)
|
6
|
-
graphql (~> 1.8.0)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: https://rubygems.org/
|
10
|
-
specs:
|
11
|
-
appraisal (2.2.0)
|
12
|
-
bundler
|
13
|
-
rake
|
14
|
-
thor (>= 0.14.0)
|
15
|
-
ast (2.4.0)
|
16
|
-
coderay (1.1.2)
|
17
|
-
concurrent-ruby (1.0.5)
|
18
|
-
diff-lcs (1.3)
|
19
|
-
dry-configurable (0.7.0)
|
20
|
-
concurrent-ruby (~> 1.0)
|
21
|
-
dry-container (0.6.0)
|
22
|
-
concurrent-ruby (~> 1.0)
|
23
|
-
dry-configurable (~> 0.1, >= 0.1.3)
|
24
|
-
dry-core (0.4.7)
|
25
|
-
concurrent-ruby (~> 1.0)
|
26
|
-
dry-equalizer (0.2.1)
|
27
|
-
dry-inflector (0.1.2)
|
28
|
-
dry-logic (0.4.2)
|
29
|
-
dry-container (~> 0.2, >= 0.2.6)
|
30
|
-
dry-core (~> 0.2)
|
31
|
-
dry-equalizer (~> 0.2)
|
32
|
-
dry-struct (0.4.0)
|
33
|
-
dry-core (~> 0.4, >= 0.4.1)
|
34
|
-
dry-equalizer (~> 0.2)
|
35
|
-
dry-types (~> 0.12, >= 0.12.2)
|
36
|
-
ice_nine (~> 0.11)
|
37
|
-
dry-types (0.13.2)
|
38
|
-
concurrent-ruby (~> 1.0)
|
39
|
-
dry-container (~> 0.3)
|
40
|
-
dry-core (~> 0.4, >= 0.4.4)
|
41
|
-
dry-equalizer (~> 0.2)
|
42
|
-
dry-inflector (~> 0.1, >= 0.1.2)
|
43
|
-
dry-logic (~> 0.4, >= 0.4.2)
|
44
|
-
graphql (1.8.10)
|
45
|
-
ice_nine (0.11.2)
|
46
|
-
jaro_winkler (1.5.1)
|
47
|
-
method_source (0.9.0)
|
48
|
-
parallel (1.12.1)
|
49
|
-
parser (2.5.1.2)
|
50
|
-
ast (~> 2.4.0)
|
51
|
-
powerpack (0.1.2)
|
52
|
-
pry (0.11.3)
|
53
|
-
coderay (~> 1.1.0)
|
54
|
-
method_source (~> 0.9.0)
|
55
|
-
rainbow (3.0.0)
|
56
|
-
rake (10.5.0)
|
57
|
-
rspec (3.8.0)
|
58
|
-
rspec-core (~> 3.8.0)
|
59
|
-
rspec-expectations (~> 3.8.0)
|
60
|
-
rspec-mocks (~> 3.8.0)
|
61
|
-
rspec-core (3.8.0)
|
62
|
-
rspec-support (~> 3.8.0)
|
63
|
-
rspec-expectations (3.8.1)
|
64
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
65
|
-
rspec-support (~> 3.8.0)
|
66
|
-
rspec-mocks (3.8.0)
|
67
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
68
|
-
rspec-support (~> 3.8.0)
|
69
|
-
rspec-support (3.8.0)
|
70
|
-
rubocop (0.59.2)
|
71
|
-
jaro_winkler (~> 1.5.1)
|
72
|
-
parallel (~> 1.10)
|
73
|
-
parser (>= 2.5, != 2.5.1.1)
|
74
|
-
powerpack (~> 0.1)
|
75
|
-
rainbow (>= 2.2.2, < 4.0)
|
76
|
-
ruby-progressbar (~> 1.7)
|
77
|
-
unicode-display_width (~> 1.0, >= 1.0.1)
|
78
|
-
ruby-progressbar (1.10.0)
|
79
|
-
thor (0.20.0)
|
80
|
-
unicode-display_width (1.4.0)
|
81
|
-
|
82
|
-
PLATFORMS
|
83
|
-
ruby
|
84
|
-
|
85
|
-
DEPENDENCIES
|
86
|
-
appraisal
|
87
|
-
bundler (~> 1.16)
|
88
|
-
dry-graphql!
|
89
|
-
dry-struct (~> 0.4.0)
|
90
|
-
graphql
|
91
|
-
pry
|
92
|
-
rake (~> 10.0)
|
93
|
-
rspec (~> 3.0)
|
94
|
-
rubocop
|
95
|
-
|
96
|
-
BUNDLED WITH
|
97
|
-
1.16.1
|
@@ -1,97 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ..
|
3
|
-
specs:
|
4
|
-
dry-graphql (0.1.0)
|
5
|
-
dry-struct (>= 0.4.0)
|
6
|
-
graphql (~> 1.8.0)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: https://rubygems.org/
|
10
|
-
specs:
|
11
|
-
appraisal (2.2.0)
|
12
|
-
bundler
|
13
|
-
rake
|
14
|
-
thor (>= 0.14.0)
|
15
|
-
ast (2.4.0)
|
16
|
-
coderay (1.1.2)
|
17
|
-
concurrent-ruby (1.0.5)
|
18
|
-
diff-lcs (1.3)
|
19
|
-
dry-configurable (0.7.0)
|
20
|
-
concurrent-ruby (~> 1.0)
|
21
|
-
dry-container (0.6.0)
|
22
|
-
concurrent-ruby (~> 1.0)
|
23
|
-
dry-configurable (~> 0.1, >= 0.1.3)
|
24
|
-
dry-core (0.4.7)
|
25
|
-
concurrent-ruby (~> 1.0)
|
26
|
-
dry-equalizer (0.2.1)
|
27
|
-
dry-inflector (0.1.2)
|
28
|
-
dry-logic (0.4.2)
|
29
|
-
dry-container (~> 0.2, >= 0.2.6)
|
30
|
-
dry-core (~> 0.2)
|
31
|
-
dry-equalizer (~> 0.2)
|
32
|
-
dry-struct (0.5.0)
|
33
|
-
dry-core (~> 0.4, >= 0.4.3)
|
34
|
-
dry-equalizer (~> 0.2)
|
35
|
-
dry-types (~> 0.13)
|
36
|
-
ice_nine (~> 0.11)
|
37
|
-
dry-types (0.13.2)
|
38
|
-
concurrent-ruby (~> 1.0)
|
39
|
-
dry-container (~> 0.3)
|
40
|
-
dry-core (~> 0.4, >= 0.4.4)
|
41
|
-
dry-equalizer (~> 0.2)
|
42
|
-
dry-inflector (~> 0.1, >= 0.1.2)
|
43
|
-
dry-logic (~> 0.4, >= 0.4.2)
|
44
|
-
graphql (1.8.10)
|
45
|
-
ice_nine (0.11.2)
|
46
|
-
jaro_winkler (1.5.1)
|
47
|
-
method_source (0.9.0)
|
48
|
-
parallel (1.12.1)
|
49
|
-
parser (2.5.1.2)
|
50
|
-
ast (~> 2.4.0)
|
51
|
-
powerpack (0.1.2)
|
52
|
-
pry (0.11.3)
|
53
|
-
coderay (~> 1.1.0)
|
54
|
-
method_source (~> 0.9.0)
|
55
|
-
rainbow (3.0.0)
|
56
|
-
rake (10.5.0)
|
57
|
-
rspec (3.8.0)
|
58
|
-
rspec-core (~> 3.8.0)
|
59
|
-
rspec-expectations (~> 3.8.0)
|
60
|
-
rspec-mocks (~> 3.8.0)
|
61
|
-
rspec-core (3.8.0)
|
62
|
-
rspec-support (~> 3.8.0)
|
63
|
-
rspec-expectations (3.8.1)
|
64
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
65
|
-
rspec-support (~> 3.8.0)
|
66
|
-
rspec-mocks (3.8.0)
|
67
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
68
|
-
rspec-support (~> 3.8.0)
|
69
|
-
rspec-support (3.8.0)
|
70
|
-
rubocop (0.59.2)
|
71
|
-
jaro_winkler (~> 1.5.1)
|
72
|
-
parallel (~> 1.10)
|
73
|
-
parser (>= 2.5, != 2.5.1.1)
|
74
|
-
powerpack (~> 0.1)
|
75
|
-
rainbow (>= 2.2.2, < 4.0)
|
76
|
-
ruby-progressbar (~> 1.7)
|
77
|
-
unicode-display_width (~> 1.0, >= 1.0.1)
|
78
|
-
ruby-progressbar (1.10.0)
|
79
|
-
thor (0.20.0)
|
80
|
-
unicode-display_width (1.4.0)
|
81
|
-
|
82
|
-
PLATFORMS
|
83
|
-
ruby
|
84
|
-
|
85
|
-
DEPENDENCIES
|
86
|
-
appraisal
|
87
|
-
bundler (~> 1.16)
|
88
|
-
dry-graphql!
|
89
|
-
dry-struct (~> 0.5.0)
|
90
|
-
graphql
|
91
|
-
pry
|
92
|
-
rake (~> 10.0)
|
93
|
-
rspec (~> 3.0)
|
94
|
-
rubocop
|
95
|
-
|
96
|
-
BUNDLED WITH
|
97
|
-
1.16.1
|