graphql-response_validator 0.0.1 → 0.0.2

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
  SHA256:
3
- metadata.gz: 59a6ee689aecc77afc491f97738976e94f41176120eb57ce4378cd94f921241d
4
- data.tar.gz: 35021c4ccc45801799003f40c26af09267d70783e6bbdb9e088aac18f2945078
3
+ metadata.gz: f8a1952254b7a2c4eca11985a317e10325d2d60cda56e1a588d5f39225b35df9
4
+ data.tar.gz: 18a70c13a551e14534605f9cfe3527db84b6f13338155fc7c37f5044826f5402
5
5
  SHA512:
6
- metadata.gz: de6caf3beae2a38edeeba7f76d290d48399b875ffa11594a6451b427969c98a685f1e9f2d4236f6143fe226276571d7865212d2b4650f99b6c639694b04e847a
7
- data.tar.gz: 31143dca640e94861279b3406a348b2eb62624546028280aeed7648bfc6d59a7d7bea28582c6a25632e2a11160148b538b930a435469cb72a0b5a2fc183c0248
6
+ metadata.gz: f81fcdf93100927467e60ec33849ea0da6d6eeeae803861c688284fcab8f4d822586b6aec327dafb71caf94eaf62e751b83aeb39ebb5942f239c59867bc25664
7
+ data.tar.gz: 39274507970a662b00eb5387f0f520211abc1d8fd20ee418b3bc5d59991d5ab410bbdf5cd47ccf1b5e6e99b004e79aca08b15861de6c750b5c0eb0d4e75e8ad3
data/README.md CHANGED
@@ -6,6 +6,12 @@ Testing GraphQL queries using fixture responses runs the risk of false-positive
6
6
  gem "graphql-response_validator"
7
7
  ```
8
8
 
9
+ Then:
10
+
11
+ ```shell
12
+ require "graphql/response_validator"
13
+ ```
14
+
9
15
  ## Usage
10
16
 
11
17
  Build a test query and its response data into a `GraphQL::ResponseValidator`, then assert that the fixture is correct for the query as part of your test:
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GraphQL
4
4
  class ResponseValidator
5
- VERSION = "0.0.1"
5
+ VERSION = "0.0.2"
6
6
  end
7
- end
7
+ end
@@ -153,7 +153,7 @@ module GraphQL
153
153
  def resolved_type(parent_type, data_part, path)
154
154
  return parent_type unless parent_type.kind.abstract?
155
155
 
156
- typename = data_part["__typename"] || data_part[@system_typename]
156
+ typename = data_part[@system_typename] || data_part["__typename"]
157
157
  if typename.nil?
158
158
  @errors << ValidationError.new("Abstract position expects `__typename` or system typename hint", path.dup)
159
159
  return nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-response_validator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg MacWilliam