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 +4 -4
- data/lib/graphql_schema.rb +8 -0
- data/lib/graphql_schema/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3e56a0c9eb93c9fcdc99f4b87e5db347198ad77
|
4
|
+
data.tar.gz: c4b4bcd8072212a439bb4e55ec83afb9bbb404dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48f91847a4fe4f55dc2fa3902a1aa166c9404e6cebed235423f8f3878d65bf2db3f10a7f10d1ba7dad0ac79c420332f7d53cd9aa7356b4d4ba109db7b74ea83f
|
7
|
+
data.tar.gz: 13992c891f1205c229a9099647f5f250360a5e9cc25dcca4c3e1852d302e44ae9a7ddcaa0f36632dee57ccfb00d6c34cddd6ff13853f5482128cefb87a400401
|
data/lib/graphql_schema.rb
CHANGED
@@ -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
|
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.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-
|
11
|
+
date: 2017-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|