graphql_schema 0.1.2 → 0.1.3

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: 2a67ab3552d63acea7c540bb23302da480ceb086
4
- data.tar.gz: 15ba4260e9dac2a749d707e58b4ef8b9f2f2e0fa
3
+ metadata.gz: 5bfa3a0670d8de22e60d7c06fd082ab9f3f8ee5f
4
+ data.tar.gz: 288dc6465191002e3e0d30add5f85b23442cd586
5
5
  SHA512:
6
- metadata.gz: 6ec16d95a0cc092b7278cce9ae7035ed010b79bcf92e5581746268a0266c52df96af3cc7427b9dbbcc6c4c94f6224edd3fca027194b9705b6ee6d0e94db39c32
7
- data.tar.gz: 41f91462ce0defc16a40f1c6df344d54e781bbb177cbcaa0af64ba5a47c6bb14fb52d5b1ec3a48e15eda01cf087960aa2bb59aea3638df9684687d6379b22b29
6
+ metadata.gz: 0d1565d897649f8e67fbcb99fc63c94e886259f0f6ee063cba7b12e2b26e45fcc3dd86a983c479ab483de7d67e7f09ad9279ab658a27f5ed5d9c3827cf210273
7
+ data.tar.gz: 732f8f6c18a8fa4767d1379956b956c7e9510725de1d722254d3d5e858aca33e056d61171cf4662a66340f78f0fe5c21c5ee551d9117529fe5e033b53d6eece6
@@ -49,6 +49,10 @@ class GraphQLSchema
49
49
  @hash.fetch('description')
50
50
  end
51
51
 
52
+ def to_h
53
+ @hash
54
+ end
55
+
52
56
  private
53
57
 
54
58
  def split_name
@@ -200,12 +204,13 @@ class GraphQLSchema
200
204
 
201
205
  class TypeDefinition < Type
202
206
  def fields(include_deprecated: false)
207
+ return unless @hash.fetch('fields')
203
208
  @fields ||= @hash.fetch('fields').map{ |field_hash| Field.new(field_hash) }
204
209
  include_deprecated ? @fields : @fields.reject(&:deprecated?)
205
210
  end
206
211
 
207
212
  def input_fields
208
- @input_fields ||= @hash.fetch('inputFields').map{ |field_hash| InputValue.new(field_hash) }
213
+ @input_fields ||= @hash.fetch('inputFields').map{ |field_hash| InputValue.new(field_hash) }.sort_by(&:name)
209
214
  end
210
215
 
211
216
  def required_input_fields
@@ -1,3 +1,3 @@
1
1
  class GraphQLSchema
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
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.2
4
+ version: 0.1.3
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: 2017-02-07 00:00:00.000000000 Z
11
+ date: 2017-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql