graphql_schema 0.1.4 → 0.1.5

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: adf5de7d466e2f5d82e84f0d5f3110c3f29f689b
4
- data.tar.gz: b5826e28c5f404d64069fba6154d2eadf157751f
3
+ metadata.gz: f3e56a0c9eb93c9fcdc99f4b87e5db347198ad77
4
+ data.tar.gz: c4b4bcd8072212a439bb4e55ec83afb9bbb404dc
5
5
  SHA512:
6
- metadata.gz: 0b4db8605eea4c05adeea448e8e2bce1d0878f17bad50a43abc0216abfb04343cac01670a188d753dd23ad6950aae61a8e2841988c1ee0f9698a8bed088fc8b0
7
- data.tar.gz: 8a3516eff7145883947485c9cd17d82b33b9b72748ba779b139ebc289740fdb5695a0a194f5bf79378a5881d03ab581cee6fc76eb2f91bad85a3f7bad00f4cf6
6
+ metadata.gz: 48f91847a4fe4f55dc2fa3902a1aa166c9404e6cebed235423f8f3878d65bf2db3f10a7f10d1ba7dad0ac79c420332f7d53cd9aa7356b4d4ba109db7b74ea83f
7
+ data.tar.gz: 13992c891f1205c229a9099647f5f250360a5e9cc25dcca4c3e1852d302e44ae9a7ddcaa0f36632dee57ccfb00d6c34cddd6ff13853f5482128cefb87a400401
@@ -24,6 +24,10 @@ class GraphQLSchema
24
24
  @types ||= @hash.fetch('types').map{ |type_hash| TypeDefinition.new(type_hash) }.sort_by(&:name)
25
25
  end
26
26
 
27
+ def types_by_name
28
+ @types_by_name ||= types.map { |type| [type.name, type] }.to_h
29
+ end
30
+
27
31
  module NamedHash
28
32
  def name
29
33
  @hash.fetch('name')
@@ -209,6 +213,10 @@ class GraphQLSchema
209
213
  include_deprecated ? @fields : @fields.reject(&:deprecated?)
210
214
  end
211
215
 
216
+ def fields_by_name
217
+ @fields_by_name ||= fields(include_deprecated: true).map{ |field| [field.name, field]}.to_h
218
+ end
219
+
212
220
  def input_fields
213
221
  @input_fields ||= @hash.fetch('inputFields').map{ |field_hash| InputValue.new(field_hash) }
214
222
  end
@@ -1,3 +1,3 @@
1
1
  class GraphQLSchema
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
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.4
4
+ version: 0.1.5
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-03-15 00:00:00.000000000 Z
11
+ date: 2017-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql