-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test with conflicting client fields
Summary: Add a test-case that demonstrates a bug in the relay-compiler where we do not validate conflicts in client fields. Reviewed By: tyao1 Differential Revision: D37069157 fbshipit-source-id: 2e3210abd9ea1cecbde7acfeb8761aa715a330b1
- Loading branch information
1 parent
0d173d6
commit 1450153
Showing
4 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...r/tests/compile_relay_artifacts/fixtures/client-fields-overlapping-error.invalid.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
==================================== INPUT ==================================== | ||
query clientFieldsOverlappingErrorQuery { | ||
client_field(arg: "Value1") | ||
client_field(arg: "Value2") | ||
} | ||
|
||
# %extensions% | ||
|
||
extend type Query { | ||
client_field(arg: String): String | ||
} | ||
==================================== OUTPUT =================================== | ||
{ | ||
"fragment": { | ||
"argumentDefinitions": [], | ||
"kind": "Fragment", | ||
"metadata": null, | ||
"name": "clientFieldsOverlappingErrorQuery", | ||
"selections": [ | ||
{ | ||
"kind": "ClientExtension", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": [ | ||
{ | ||
"kind": "Literal", | ||
"name": "arg", | ||
"value": "Value1" | ||
} | ||
], | ||
"kind": "ScalarField", | ||
"name": "client_field", | ||
"storageKey": "client_field(arg:\"Value1\")" | ||
} | ||
] | ||
} | ||
], | ||
"type": "Query", | ||
"abstractKey": null | ||
}, | ||
"kind": "Request", | ||
"operation": { | ||
"argumentDefinitions": [], | ||
"kind": "Operation", | ||
"name": "clientFieldsOverlappingErrorQuery", | ||
"selections": [ | ||
{ | ||
"kind": "ClientExtension", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": [ | ||
{ | ||
"kind": "Literal", | ||
"name": "arg", | ||
"value": "Value1" | ||
} | ||
], | ||
"kind": "ScalarField", | ||
"name": "client_field", | ||
"storageKey": "client_field(arg:\"Value1\")" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"params": { | ||
"cacheID": "94883f2a9cbd52c2f01b84f026506e89", | ||
"id": null, | ||
"metadata": {}, | ||
"name": "clientFieldsOverlappingErrorQuery", | ||
"operationKind": "query", | ||
"text": null | ||
} | ||
} | ||
|
||
QUERY: | ||
|
||
Query Text is Empty. |
10 changes: 10 additions & 0 deletions
10
...er/tests/compile_relay_artifacts/fixtures/client-fields-overlapping-error.invalid.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
query clientFieldsOverlappingErrorQuery { | ||
client_field(arg: "Value1") | ||
client_field(arg: "Value2") | ||
} | ||
|
||
# %extensions% | ||
|
||
extend type Query { | ||
client_field(arg: String): String | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters