graphql_schema 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/graphql_schema.gemspec +1 -1
- data/lib/graphql_schema.rb +14 -4
- data/lib/graphql_schema/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8190a00d151a95ef02147ef2fc25b5a15db7e9d3
|
4
|
+
data.tar.gz: 44ff533c33ec71b7b191f2a81e1c22d265a824a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82dcaed1befa7bc2be285668aec91f2f251537e9e5d2b3fd04b0c3fdb549591d8ddf93745797cfa73cad3e4005ca2ad352486d67971b7ee069d8fd2ca756b641
|
7
|
+
data.tar.gz: a873ba9f6d550fb7b776b9cb76c59b7813c986bd0b4c253f3e5f96dd520da69866a4759a25be81d3c109ba720f1a36b8f8be37e726f3fd354d6c6617b524697f
|
data/graphql_schema.gemspec
CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_development_dependency "graphql", "~> 1.2"
|
24
24
|
spec.add_development_dependency "byebug", '~> 9.0' if RUBY_ENGINE == 'ruby'
|
25
|
-
spec.add_development_dependency "bundler", "~> 1.
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.12"
|
26
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
27
27
|
spec.add_development_dependency "minitest", "~> 5.0"
|
28
28
|
end
|
data/lib/graphql_schema.rb
CHANGED
@@ -15,7 +15,9 @@ class GraphQLSchema
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def mutation_root_name
|
18
|
-
|
18
|
+
if mutation_type = @hash.fetch('mutationType')
|
19
|
+
mutation_type.fetch('name')
|
20
|
+
end
|
19
21
|
end
|
20
22
|
|
21
23
|
def types
|
@@ -60,7 +62,7 @@ class GraphQLSchema
|
|
60
62
|
end
|
61
63
|
end
|
62
64
|
|
63
|
-
class
|
65
|
+
class InputValue
|
64
66
|
include NamedHash
|
65
67
|
|
66
68
|
def initialize(arg_hash)
|
@@ -70,6 +72,10 @@ class GraphQLSchema
|
|
70
72
|
def type
|
71
73
|
@type ||= TypeDeclaration.new(@hash.fetch('type'))
|
72
74
|
end
|
75
|
+
|
76
|
+
def default_value
|
77
|
+
@default_value ||= @hash.fetch('defaultValue')
|
78
|
+
end
|
73
79
|
end
|
74
80
|
|
75
81
|
class Field
|
@@ -81,7 +87,7 @@ class GraphQLSchema
|
|
81
87
|
end
|
82
88
|
|
83
89
|
def args
|
84
|
-
@args ||= @hash.fetch('args').map{ |arg_hash|
|
90
|
+
@args ||= @hash.fetch('args').map{ |arg_hash| InputValue.new(arg_hash) }
|
85
91
|
end
|
86
92
|
|
87
93
|
def required_args
|
@@ -139,6 +145,10 @@ class GraphQLSchema
|
|
139
145
|
kind == 'INTERFACE'
|
140
146
|
end
|
141
147
|
|
148
|
+
def enum?
|
149
|
+
kind == 'ENUM'
|
150
|
+
end
|
151
|
+
|
142
152
|
def union?
|
143
153
|
kind == 'UNION'
|
144
154
|
end
|
@@ -191,7 +201,7 @@ class GraphQLSchema
|
|
191
201
|
end
|
192
202
|
|
193
203
|
def input_fields
|
194
|
-
@input_fields ||= @hash.fetch('inputFields').map{ |field_hash|
|
204
|
+
@input_fields ||= @hash.fetch('inputFields').map{ |field_hash| InputValue.new(field_hash) }
|
195
205
|
end
|
196
206
|
|
197
207
|
def required_input_fields
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql_schema
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dylan Thacker-Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
47
|
+
version: '1.12'
|
48
48
|
type: :development
|
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: '1.
|
54
|
+
version: '1.12'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.6.10
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: Classes for convenient use of GraphQL introspection result
|