-
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 tests with custom node query variable name
- Loading branch information
1 parent
70ef1a5
commit 9f3f74d
Showing
5 changed files
with
1,118 additions
and
34 deletions.
There are no files selected for viewing
282 changes: 282 additions & 0 deletions
282
...cts_with_custom_id/fixtures/fragment-on-node-interface-with-custom-variable-name.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,282 @@ | ||
==================================== INPUT ==================================== | ||
fragment fragmentOnNodeInterface_RefetchableFragment on Node | ||
@refetchable(queryName: "RefetchableFragmentQuery") { | ||
global_id | ||
... on User { | ||
name | ||
...fragmentOnNodeInterface_ProfilePicture | ||
} | ||
} | ||
|
||
fragment fragmentOnNodeInterface_ProfilePicture on User { | ||
profilePicture(size: $size) { | ||
uri | ||
} | ||
} | ||
==================================== OUTPUT =================================== | ||
{ | ||
"fragment": { | ||
"argumentDefinitions": [ | ||
{ | ||
"defaultValue": null, | ||
"kind": "LocalArgument", | ||
"name": "global_id" | ||
}, | ||
{ | ||
"defaultValue": null, | ||
"kind": "LocalArgument", | ||
"name": "size" | ||
} | ||
], | ||
"kind": "Fragment", | ||
"metadata": null, | ||
"name": "RefetchableFragmentQuery", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": [ | ||
{ | ||
"kind": "Variable", | ||
"name": "global_id", | ||
"variableName": "global_id" | ||
} | ||
], | ||
"concreteType": null, | ||
"kind": "LinkedField", | ||
"name": "node", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"args": null, | ||
"kind": "FragmentSpread", | ||
"name": "fragmentOnNodeInterface_RefetchableFragment" | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
], | ||
"type": "Query", | ||
"abstractKey": null | ||
}, | ||
"kind": "Request", | ||
"operation": { | ||
"argumentDefinitions": [ | ||
{ | ||
"defaultValue": null, | ||
"kind": "LocalArgument", | ||
"name": "size" | ||
}, | ||
{ | ||
"defaultValue": null, | ||
"kind": "LocalArgument", | ||
"name": "global_id" | ||
} | ||
], | ||
"kind": "Operation", | ||
"name": "RefetchableFragmentQuery", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": [ | ||
{ | ||
"kind": "Variable", | ||
"name": "global_id", | ||
"variableName": "global_id" | ||
} | ||
], | ||
"concreteType": null, | ||
"kind": "LinkedField", | ||
"name": "node", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "__typename", | ||
"storageKey": null | ||
}, | ||
{ | ||
"kind": "TypeDiscriminator", | ||
"abstractKey": "__isNode" | ||
}, | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "global_id", | ||
"storageKey": null | ||
}, | ||
{ | ||
"kind": "InlineFragment", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "name", | ||
"storageKey": null | ||
}, | ||
{ | ||
"alias": null, | ||
"args": [ | ||
{ | ||
"kind": "Variable", | ||
"name": "size", | ||
"variableName": "size" | ||
} | ||
], | ||
"concreteType": "Image", | ||
"kind": "LinkedField", | ||
"name": "profilePicture", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "uri", | ||
"storageKey": null | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
], | ||
"type": "User", | ||
"abstractKey": null | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
] | ||
}, | ||
"params": { | ||
"cacheID": "31dcd57f42128b8d975e6224202a17c9", | ||
"id": null, | ||
"metadata": {}, | ||
"name": "RefetchableFragmentQuery", | ||
"operationKind": "query", | ||
"text": null | ||
} | ||
} | ||
|
||
QUERY: | ||
|
||
query RefetchableFragmentQuery( | ||
$size: [Int] | ||
$global_id: ID! | ||
) { | ||
node(global_id: $global_id) { | ||
__typename | ||
...fragmentOnNodeInterface_RefetchableFragment | ||
global_id | ||
} | ||
} | ||
|
||
fragment fragmentOnNodeInterface_ProfilePicture on User { | ||
profilePicture(size: $size) { | ||
uri | ||
} | ||
} | ||
|
||
fragment fragmentOnNodeInterface_RefetchableFragment on Node { | ||
__isNode: __typename | ||
global_id | ||
... on User { | ||
name | ||
...fragmentOnNodeInterface_ProfilePicture | ||
} | ||
} | ||
|
||
|
||
{ | ||
"argumentDefinitions": [ | ||
{ | ||
"kind": "RootArgument", | ||
"name": "size" | ||
} | ||
], | ||
"kind": "Fragment", | ||
"metadata": null, | ||
"name": "fragmentOnNodeInterface_ProfilePicture", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": [ | ||
{ | ||
"kind": "Variable", | ||
"name": "size", | ||
"variableName": "size" | ||
} | ||
], | ||
"concreteType": "Image", | ||
"kind": "LinkedField", | ||
"name": "profilePicture", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "uri", | ||
"storageKey": null | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
], | ||
"type": "User", | ||
"abstractKey": null | ||
} | ||
|
||
{ | ||
"argumentDefinitions": [ | ||
{ | ||
"kind": "RootArgument", | ||
"name": "size" | ||
} | ||
], | ||
"kind": "Fragment", | ||
"metadata": { | ||
"refetch": { | ||
"connection": null, | ||
"fragmentPathInResult": [ | ||
"node" | ||
], | ||
"operation": require('RefetchableFragmentQuery.graphql'), | ||
"identifierField": "global_id", | ||
"identifierQueryVariableName": "variable_name" | ||
} | ||
}, | ||
"name": "fragmentOnNodeInterface_RefetchableFragment", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "global_id", | ||
"storageKey": null | ||
}, | ||
{ | ||
"kind": "InlineFragment", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "name", | ||
"storageKey": null | ||
}, | ||
{ | ||
"args": null, | ||
"kind": "FragmentSpread", | ||
"name": "fragmentOnNodeInterface_ProfilePicture" | ||
} | ||
], | ||
"type": "User", | ||
"abstractKey": null | ||
} | ||
], | ||
"type": "Node", | ||
"abstractKey": "__isNode" | ||
} |
Oops, something went wrong.