-
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 fixture test for duplicated selections
Reviewed By: captbaritone Differential Revision: D52609668 fbshipit-source-id: f16061e29ef07b75378c6272cb3f57f5e005f823
- Loading branch information
1 parent
9f135b8
commit 2620736
Showing
3 changed files
with
175 additions
and
1 deletion.
There are no files selected for viewing
141 changes: 141 additions & 0 deletions
141
...ompiler/tests/compile_relay_artifacts/fixtures/client-inline-fragments-duplicate.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,141 @@ | ||
==================================== INPUT ==================================== | ||
query clientInlineFragmentsDuplicateQuery { | ||
cat { | ||
description | ||
description | ||
... on Tabby { | ||
greeting | ||
} | ||
... on Tabby { | ||
greeting | ||
} | ||
} | ||
} | ||
|
||
# %extensions% | ||
interface Cat { | ||
description: String | ||
} | ||
|
||
type Tabby implements Cat { | ||
description: String | ||
greeting: String | ||
} | ||
|
||
extend type Query { | ||
cat: Cat | ||
} | ||
==================================== OUTPUT =================================== | ||
{ | ||
"fragment": { | ||
"argumentDefinitions": [], | ||
"kind": "Fragment", | ||
"metadata": null, | ||
"name": "clientInlineFragmentsDuplicateQuery", | ||
"selections": [ | ||
{ | ||
"kind": "ClientExtension", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"concreteType": null, | ||
"kind": "LinkedField", | ||
"name": "cat", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "description", | ||
"storageKey": null | ||
}, | ||
{ | ||
"kind": "InlineFragment", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "greeting", | ||
"storageKey": null | ||
} | ||
], | ||
"type": "Tabby", | ||
"abstractKey": null | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
] | ||
} | ||
], | ||
"type": "Query", | ||
"abstractKey": null | ||
}, | ||
"kind": "Request", | ||
"operation": { | ||
"argumentDefinitions": [], | ||
"kind": "Operation", | ||
"name": "clientInlineFragmentsDuplicateQuery", | ||
"selections": [ | ||
{ | ||
"kind": "ClientExtension", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"concreteType": null, | ||
"kind": "LinkedField", | ||
"name": "cat", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "__typename", | ||
"storageKey": null | ||
}, | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "description", | ||
"storageKey": null | ||
}, | ||
{ | ||
"kind": "InlineFragment", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "greeting", | ||
"storageKey": null | ||
} | ||
], | ||
"type": "Tabby", | ||
"abstractKey": null | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"params": { | ||
"cacheID": "a22161d66129f4ea54b4be1a1b16caa8", | ||
"id": null, | ||
"metadata": {}, | ||
"name": "clientInlineFragmentsDuplicateQuery", | ||
"operationKind": "query", | ||
"text": null | ||
} | ||
} | ||
|
||
QUERY: | ||
|
||
Query Text is Empty. |
26 changes: 26 additions & 0 deletions
26
...compiler/tests/compile_relay_artifacts/fixtures/client-inline-fragments-duplicate.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,26 @@ | ||
query clientInlineFragmentsDuplicateQuery { | ||
cat { | ||
description | ||
description | ||
... on Tabby { | ||
greeting | ||
} | ||
... on Tabby { | ||
greeting | ||
} | ||
} | ||
} | ||
|
||
# %extensions% | ||
interface Cat { | ||
description: String | ||
} | ||
|
||
type Tabby implements Cat { | ||
description: String | ||
greeting: String | ||
} | ||
|
||
extend type Query { | ||
cat: Cat | ||
} |
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