graphql_schema 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5baf3ee59c551fd336943f2729bab7711042b8ad
4
- data.tar.gz: 077522f2b78fde33cf8f4b212c75501ddc8c259e
3
+ metadata.gz: 8190a00d151a95ef02147ef2fc25b5a15db7e9d3
4
+ data.tar.gz: 44ff533c33ec71b7b191f2a81e1c22d265a824a5
5
5
  SHA512:
6
- metadata.gz: 24573fc0b1815b5afcebf6d71895f112f8fbd20919dd195940223187eecb453f0d801a09e1cf6d1e9074e94aa9f0b13408c08979e184d8b0b384067c0230accf
7
- data.tar.gz: a291436003bf8001294dc41056406763cbdb3a2b2da25cde900fbb03d3dde7eee15b3695fcf64d385e74964f4681be47d774f3bca3cf949955a342bd40a210df
6
+ metadata.gz: 82dcaed1befa7bc2be285668aec91f2f251537e9e5d2b3fd04b0c3fdb549591d8ddf93745797cfa73cad3e4005ca2ad352486d67971b7ee069d8fd2ca756b641
7
+ data.tar.gz: a873ba9f6d550fb7b776b9cb76c59b7813c986bd0b4c253f3e5f96dd520da69866a4759a25be81d3c109ba720f1a36b8f8be37e726f3fd354d6c6617b524697f
@@ -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.13"
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
@@ -15,7 +15,9 @@ class GraphQLSchema
15
15
  end
16
16
 
17
17
  def mutation_root_name
18
- @mutation_root_name ||= @hash.fetch('mutationType', {}).fetch('name')
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 Argument
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| Argument.new(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| Field.new(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
@@ -1,3 +1,3 @@
1
1
  class GraphQLSchema
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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: 2016-11-24 00:00:00.000000000 Z
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.13'
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.13'
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.5.1
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