graphql-client 0.8.6 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 682f2fda3a85b90c7f7ebe9ff03c6c3b8a6853e3
|
4
|
+
data.tar.gz: 85ad7663333b37fc0e7407254211b88ea670dab6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8df3fe212b2ae0ba9ed43b26b326a40d54e5de231bd1958cd1538cdf5fef6d4cf65743938c73310bc84523f053e2ac4cd4a8da90c5015cf1d9195215d261d74e
|
7
|
+
data.tar.gz: 0e0fa5380ae41b37113927d592ccdb39e03f586a2a07155e590963b2c4d07a1c5048e83357aadfa0c7ecd0e8e7cfeba130ec4d1cbfd4ebf0a9766733151e1fdb
|
data/lib/graphql/client.rb
CHANGED
@@ -3,8 +3,8 @@ require "active_support/inflector"
|
|
3
3
|
require "active_support/notifications"
|
4
4
|
require "graphql"
|
5
5
|
require "graphql/client/collocated_enforcement"
|
6
|
-
require "graphql/client/definition"
|
7
6
|
require "graphql/client/definition_variables"
|
7
|
+
require "graphql/client/definition"
|
8
8
|
require "graphql/client/error"
|
9
9
|
require "graphql/client/errors"
|
10
10
|
require "graphql/client/fragment_definition"
|
data/lib/graphql/client/error.rb
CHANGED
@@ -4,5 +4,14 @@ module GraphQL
|
|
4
4
|
# Public: Abstract base class for all errors raised by GraphQL::Client.
|
5
5
|
class Error < StandardError
|
6
6
|
end
|
7
|
+
|
8
|
+
class ImplicitlyFetchedFieldError < NoMethodError
|
9
|
+
end
|
10
|
+
|
11
|
+
class UnfetchedFieldError < NoMethodError
|
12
|
+
end
|
13
|
+
|
14
|
+
class UnimplementedFieldError < NoMethodError
|
15
|
+
end
|
7
16
|
end
|
8
17
|
end
|
@@ -4,6 +4,11 @@ require "graphql/client/erubis_enhancer"
|
|
4
4
|
|
5
5
|
module GraphQL
|
6
6
|
class Client
|
7
|
+
# Ignore deprecation errors loading AV Erubis
|
8
|
+
ActiveSupport::Deprecation.silence do
|
9
|
+
ActionView::Template::Handlers::Erubis
|
10
|
+
end
|
11
|
+
|
7
12
|
# Public: Extended Erubis implementation that supports GraphQL static
|
8
13
|
# query sections.
|
9
14
|
#
|
@@ -1,11 +1,19 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "graphql/client/definition"
|
4
|
+
require "graphql/client/deprecation"
|
4
5
|
|
5
6
|
module GraphQL
|
6
7
|
class Client
|
7
8
|
# Specific fragment definition subtype.
|
8
9
|
class FragmentDefinition < Definition
|
10
|
+
def new(obj, *args)
|
11
|
+
if obj.is_a?(Hash)
|
12
|
+
GraphQL::Client::Deprecation.warn("constructing fragment wrapper from Hash is deprecated")
|
13
|
+
end
|
14
|
+
|
15
|
+
super
|
16
|
+
end
|
9
17
|
end
|
10
18
|
end
|
11
19
|
end
|
@@ -14,11 +14,6 @@ module GraphQL
|
|
14
14
|
#
|
15
15
|
# Wrappers also limit field visibility to fragment definitions.
|
16
16
|
class QueryResult
|
17
|
-
class NoFieldError < Error; end
|
18
|
-
class ImplicitlyFetchedFieldError < NoFieldError; end
|
19
|
-
class UnfetchedFieldError < NoFieldError; end
|
20
|
-
class UnimplementedFieldError < NoFieldError; end
|
21
|
-
|
22
17
|
# Internal: Get QueryResult class for result of query.
|
23
18
|
#
|
24
19
|
# Returns subclass of QueryResult or nil.
|
@@ -266,10 +261,6 @@ module GraphQL
|
|
266
261
|
def schema
|
267
262
|
source_definition.schema
|
268
263
|
end
|
269
|
-
|
270
|
-
def [](name)
|
271
|
-
fields[name]
|
272
|
-
end
|
273
264
|
end
|
274
265
|
|
275
266
|
def self.name
|
@@ -284,6 +275,8 @@ module GraphQL
|
|
284
275
|
case obj
|
285
276
|
when Hash
|
286
277
|
new(obj, errors)
|
278
|
+
when Array
|
279
|
+
obj.map { |o| new(o, errors) }
|
287
280
|
when self
|
288
281
|
obj
|
289
282
|
when QueryResult
|
@@ -398,8 +391,6 @@ module GraphQL
|
|
398
391
|
message = "unfetched field `#{field.name}' on #{type} type. https://git.io/v1y3U"
|
399
392
|
end
|
400
393
|
|
401
|
-
node = self.class.source_node
|
402
|
-
message += "\n\n" + node.to_query_string.sub(/\}$/, "+ #{field.name}\n}") if node
|
403
394
|
raise error_class, message
|
404
395
|
end
|
405
396
|
|
@@ -16,13 +16,6 @@ module GraphQL
|
|
16
16
|
config.graphql = ActiveSupport::OrderedOptions.new
|
17
17
|
config.graphql.client = GraphQL::Client.new
|
18
18
|
|
19
|
-
# Eager load leaky dependency to workaround AS::Dependencies unloading issues
|
20
|
-
# https://github.com/rmosolgo/graphql-ruby/pull/240
|
21
|
-
initializer "graphql.eager_load_hack" do |_app|
|
22
|
-
require "graphql"
|
23
|
-
GraphQL::BOOLEAN_TYPE.name
|
24
|
-
end
|
25
|
-
|
26
19
|
initializer "graphql.configure_log_subscriber" do |_app|
|
27
20
|
require "graphql/client/log_subscriber"
|
28
21
|
GraphQL::Client::LogSubscriber.attach_to :graphql
|
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.9.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-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '1.
|
39
|
+
version: '1.5'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '1.
|
46
|
+
version: '1.5'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: actionpack
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
201
201
|
version: '0'
|
202
202
|
requirements: []
|
203
203
|
rubyforge_project:
|
204
|
-
rubygems_version: 2.
|
204
|
+
rubygems_version: 2.6.11
|
205
205
|
signing_key:
|
206
206
|
specification_version: 4
|
207
207
|
summary: GraphQL Client
|