graphql-client 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/graphql/client/query_result.rb +12 -0
- data/lib/rubocop/cop/graphql/overfetch.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b80039f5eb8bb0137f9710546e4fee2a28e779b0
|
4
|
+
data.tar.gz: 78f1776948df0242e6d2a1c9140b3294b9a01b53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ac3819f316fb2bbba8ad2dc59bd902343fe4d9945b6fb91ecfde1a999de898d8430212cd7308c957c24ba12553fb97813ff1028cffa7ac47b99cc60b0073f04
|
7
|
+
data.tar.gz: c5a4f90cfc142f8e69d77950ddfb4ee329eb027abb7b041aff23b07d79c1a43235d25a0b84ac11860125e6d82e5dbbaa12d8c4b0f7cef105f1a3f41dcc512d14
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ module SWAPI
|
|
22
22
|
|
23
23
|
# However, its smart to dump this to a JSON file and load from disk
|
24
24
|
#
|
25
|
-
# Run
|
25
|
+
# Run it from a script or rake task
|
26
26
|
# GraphQL::Client.dump_schema(SWAPI::HTTP, "path/to/schema.json")
|
27
27
|
#
|
28
28
|
# Schema = GraphQL::Client.load_schema("path/to/schema.json")
|
@@ -147,6 +147,10 @@ module GraphQL
|
|
147
147
|
|
148
148
|
attr_reader :fields
|
149
149
|
|
150
|
+
def schema
|
151
|
+
source_definition.schema
|
152
|
+
end
|
153
|
+
|
150
154
|
def [](name)
|
151
155
|
fields[name]
|
152
156
|
end
|
@@ -229,6 +233,14 @@ module GraphQL
|
|
229
233
|
attr_reader :__typename
|
230
234
|
alias typename __typename
|
231
235
|
|
236
|
+
def type_of?(type)
|
237
|
+
if type = self.class.schema.types.fetch(type.to_s, nil)
|
238
|
+
self.class.schema.possible_types(type).any? { |t| __typename == t.name }
|
239
|
+
else
|
240
|
+
false
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
232
244
|
def inspect
|
233
245
|
ivars = self.class.fields.keys.map do |sym|
|
234
246
|
value = instance_variable_get("@#{sym}")
|
@@ -9,7 +9,7 @@ module RuboCop
|
|
9
9
|
module GraphQL
|
10
10
|
# Public: Rubocop for catching overfetched fields in ERB templates.
|
11
11
|
class Overfetch < Cop
|
12
|
-
def_node_search :send_methods, "(send ...)"
|
12
|
+
def_node_search :send_methods, "({send csend} ...)"
|
13
13
|
|
14
14
|
def investigate(processed_source)
|
15
15
|
erb = File.read(processed_source.buffer.name)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -98,28 +98,28 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - "~>"
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: '0.
|
101
|
+
version: '0.3'
|
102
102
|
type: :development
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
106
|
- - "~>"
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version: '0.
|
108
|
+
version: '0.3'
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: rubocop
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
112
112
|
requirements:
|
113
113
|
- - "~>"
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
version: '0.
|
115
|
+
version: '0.47'
|
116
116
|
type: :development
|
117
117
|
prerelease: false
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
120
|
- - "~>"
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: '0.
|
122
|
+
version: '0.47'
|
123
123
|
description: A Ruby library for declaring, composing and executing GraphQL queries
|
124
124
|
email: engineering@github.com
|
125
125
|
executables: []
|
@@ -166,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
166
|
version: '0'
|
167
167
|
requirements: []
|
168
168
|
rubyforge_project:
|
169
|
-
rubygems_version: 2.5.
|
169
|
+
rubygems_version: 2.5.2
|
170
170
|
signing_key:
|
171
171
|
specification_version: 4
|
172
172
|
summary: GraphQL Client
|