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 +4 -4
- data/README.md +6 -0
- data/lib/graphql/response_validator/version.rb +2 -2
- data/lib/graphql/response_validator.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8a1952254b7a2c4eca11985a317e10325d2d60cda56e1a588d5f39225b35df9
|
4
|
+
data.tar.gz: 18a70c13a551e14534605f9cfe3527db84b6f13338155fc7c37f5044826f5402
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
@@ -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[
|
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
|