graphql 1.7.12 → 1.7.13
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 +4 -4
- data/lib/graphql/schema.rb +1 -1
- data/lib/graphql/version.rb +1 -1
- data/spec/graphql/rake_task_spec.rb +3 -1
- data/spec/graphql/schema_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 48328205063447093cf672bfb523fbd04daff07d79070f2f0848c05550198de2
|
|
4
|
+
data.tar.gz: d56689df8a571faa92ab90a434afe18561fc2b1b1713800bfb5b883e338703d9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1ce5c01f9aa6b1a5dab90b1bd94b0235042cd594ba7e07dea9773b8918fbdd9f4c57289990f7f773e6bd3f46c03086947101db0fb8fdb9bad904b1516855d33e
|
|
7
|
+
data.tar.gz: b9924f719422270083d1a8275f4b9435f4c206d77d18bb933fd6f82f401d3c32f5a358f080a9a44838d564d4e6192cd14673cd4dd64fba94e57066615d3e055c
|
data/lib/graphql/schema.rb
CHANGED
|
@@ -554,7 +554,7 @@ module GraphQL
|
|
|
554
554
|
# @param except [<#call(member, ctx)>]
|
|
555
555
|
# @return [Hash] GraphQL result
|
|
556
556
|
def as_json(only: nil, except: nil, context: {})
|
|
557
|
-
execute(Introspection::INTROSPECTION_QUERY, only: only, except: except, context: context)
|
|
557
|
+
execute(Introspection::INTROSPECTION_QUERY, only: only, except: except, context: context).to_h
|
|
558
558
|
end
|
|
559
559
|
|
|
560
560
|
# Returns the JSON response of {Introspection::INTROSPECTION_QUERY}.
|
data/lib/graphql/version.rb
CHANGED
|
@@ -34,7 +34,9 @@ describe GraphQL::RakeTask do
|
|
|
34
34
|
end
|
|
35
35
|
dumped_json = File.read("./schema.json")
|
|
36
36
|
expected_json = JSON.pretty_generate(RakeTaskSchema.execute(GraphQL::Introspection::INTROSPECTION_QUERY))
|
|
37
|
-
|
|
37
|
+
|
|
38
|
+
# Test that that JSON is logically equivalent, not serialized the same
|
|
39
|
+
assert_equal(JSON.parse(expected_json), JSON.parse(dumped_json))
|
|
38
40
|
|
|
39
41
|
dumped_idl = File.read("./schema.graphql")
|
|
40
42
|
expected_idl = rake_task_schema_defn.chomp
|
data/spec/graphql/schema_spec.rb
CHANGED
|
@@ -425,6 +425,13 @@ type Query {
|
|
|
425
425
|
end
|
|
426
426
|
end
|
|
427
427
|
|
|
428
|
+
describe "#as_json" do
|
|
429
|
+
it "returns a hash" do
|
|
430
|
+
result = schema.execute(GraphQL::Introspection::INTROSPECTION_QUERY)
|
|
431
|
+
assert_equal result.as_json.class, Hash
|
|
432
|
+
end
|
|
433
|
+
end
|
|
434
|
+
|
|
428
435
|
describe "#get_field" do
|
|
429
436
|
it "returns fields by type or type name" do
|
|
430
437
|
field = schema.get_field("Cheese", "id")
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: graphql
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.7.
|
|
4
|
+
version: 1.7.13
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robert Mosolgo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-02-
|
|
11
|
+
date: 2018-02-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: benchmark-ips
|