-
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.
Summary: See D34813394 (c0a1b67) for a full explanation. # This diff * Enables updatable fragments * Adds a few fixtures showing default behavior. This includes behavior that will be disallowed (e.g. directives on updatable fragment spreads) Reviewed By: captbaritone Differential Revision: D34810839 fbshipit-source-id: 5ee3203cf8644df95724a56e6fa312758738a143
- Loading branch information
1 parent
eace17e
commit f199ede
Showing
20 changed files
with
819 additions
and
30 deletions.
There are no files selected for viewing
123 changes: 123 additions & 0 deletions
123
...iler/tests/compile_relay_artifacts/fixtures/updatable-fragment-spread-with-defer.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,123 @@ | ||
==================================== INPUT ==================================== | ||
query updatableFragmentSpreadWithDeferQuery { | ||
me { | ||
...updatableFragmentSpreadWithDefer_user @defer | ||
} | ||
} | ||
|
||
fragment updatableFragmentSpreadWithDefer_user on User @updatable { | ||
firstName | ||
} | ||
==================================== OUTPUT =================================== | ||
{ | ||
"fragment": { | ||
"argumentDefinitions": [], | ||
"kind": "Fragment", | ||
"metadata": null, | ||
"name": "updatableFragmentSpreadWithDeferQuery", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"concreteType": "User", | ||
"kind": "LinkedField", | ||
"name": "me", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"kind": "Defer", | ||
"selections": [ | ||
{ | ||
"args": null, | ||
"kind": "FragmentSpread", | ||
"name": "updatableFragmentSpreadWithDefer_user" | ||
} | ||
] | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
], | ||
"type": "Query", | ||
"abstractKey": null | ||
}, | ||
"kind": "Request", | ||
"operation": { | ||
"argumentDefinitions": [], | ||
"kind": "Operation", | ||
"name": "updatableFragmentSpreadWithDeferQuery", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"concreteType": "User", | ||
"kind": "LinkedField", | ||
"name": "me", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"if": null, | ||
"kind": "Defer", | ||
"label": "updatableFragmentSpreadWithDeferQuery$defer$updatableFragmentSpreadWithDefer_user", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "firstName", | ||
"storageKey": null | ||
} | ||
] | ||
}, | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "id", | ||
"storageKey": null | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
] | ||
}, | ||
"params": { | ||
"id": null, | ||
"metadata": {}, | ||
"name": "updatableFragmentSpreadWithDeferQuery", | ||
"operationKind": "query", | ||
"text": null | ||
} | ||
} | ||
|
||
QUERY: | ||
|
||
query updatableFragmentSpreadWithDeferQuery { | ||
me { | ||
...updatableFragmentSpreadWithDefer_user @defer(label: "updatableFragmentSpreadWithDeferQuery$defer$updatableFragmentSpreadWithDefer_user") | ||
id | ||
} | ||
} | ||
|
||
fragment updatableFragmentSpreadWithDefer_user on User { | ||
firstName | ||
} | ||
|
||
|
||
{ | ||
"argumentDefinitions": [], | ||
"kind": "Fragment", | ||
"metadata": null, | ||
"name": "updatableFragmentSpreadWithDefer_user", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "firstName", | ||
"storageKey": null | ||
} | ||
], | ||
"type": "User", | ||
"abstractKey": null | ||
} |
9 changes: 9 additions & 0 deletions
9
...piler/tests/compile_relay_artifacts/fixtures/updatable-fragment-spread-with-defer.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,9 @@ | ||
query updatableFragmentSpreadWithDeferQuery { | ||
me { | ||
...updatableFragmentSpreadWithDefer_user @defer | ||
} | ||
} | ||
|
||
fragment updatableFragmentSpreadWithDefer_user on User @updatable { | ||
firstName | ||
} |
139 changes: 139 additions & 0 deletions
139
...er/tests/compile_relay_artifacts/fixtures/updatable-fragment-spread-with-include.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,139 @@ | ||
==================================== INPUT ==================================== | ||
query updatableFragmentSpreadWithIncludeQuery($if: Boolean!) { | ||
me { | ||
...updatableFragmentSpreadWithInclude_user @include(if: $if) | ||
} | ||
} | ||
|
||
fragment updatableFragmentSpreadWithInclude_user on User @updatable { | ||
firstName | ||
} | ||
==================================== OUTPUT =================================== | ||
{ | ||
"fragment": { | ||
"argumentDefinitions": [ | ||
{ | ||
"defaultValue": null, | ||
"kind": "LocalArgument", | ||
"name": "if" | ||
} | ||
], | ||
"kind": "Fragment", | ||
"metadata": null, | ||
"name": "updatableFragmentSpreadWithIncludeQuery", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"concreteType": "User", | ||
"kind": "LinkedField", | ||
"name": "me", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"condition": "if", | ||
"kind": "Condition", | ||
"passingValue": true, | ||
"selections": [ | ||
{ | ||
"args": null, | ||
"kind": "FragmentSpread", | ||
"name": "updatableFragmentSpreadWithInclude_user" | ||
} | ||
] | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
], | ||
"type": "Query", | ||
"abstractKey": null | ||
}, | ||
"kind": "Request", | ||
"operation": { | ||
"argumentDefinitions": [ | ||
{ | ||
"defaultValue": null, | ||
"kind": "LocalArgument", | ||
"name": "if" | ||
} | ||
], | ||
"kind": "Operation", | ||
"name": "updatableFragmentSpreadWithIncludeQuery", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"concreteType": "User", | ||
"kind": "LinkedField", | ||
"name": "me", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"condition": "if", | ||
"kind": "Condition", | ||
"passingValue": true, | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "firstName", | ||
"storageKey": null | ||
} | ||
] | ||
}, | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "id", | ||
"storageKey": null | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
] | ||
}, | ||
"params": { | ||
"id": null, | ||
"metadata": {}, | ||
"name": "updatableFragmentSpreadWithIncludeQuery", | ||
"operationKind": "query", | ||
"text": null | ||
} | ||
} | ||
|
||
QUERY: | ||
|
||
query updatableFragmentSpreadWithIncludeQuery( | ||
$if: Boolean! | ||
) { | ||
me { | ||
...updatableFragmentSpreadWithInclude_user @include(if: $if) | ||
id | ||
} | ||
} | ||
|
||
fragment updatableFragmentSpreadWithInclude_user on User { | ||
firstName | ||
} | ||
|
||
|
||
{ | ||
"argumentDefinitions": [], | ||
"kind": "Fragment", | ||
"metadata": null, | ||
"name": "updatableFragmentSpreadWithInclude_user", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "firstName", | ||
"storageKey": null | ||
} | ||
], | ||
"type": "User", | ||
"abstractKey": null | ||
} |
9 changes: 9 additions & 0 deletions
9
...ler/tests/compile_relay_artifacts/fixtures/updatable-fragment-spread-with-include.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,9 @@ | ||
query updatableFragmentSpreadWithIncludeQuery($if: Boolean!) { | ||
me { | ||
...updatableFragmentSpreadWithInclude_user @include(if: $if) | ||
} | ||
} | ||
|
||
fragment updatableFragmentSpreadWithInclude_user on User @updatable { | ||
firstName | ||
} |
Oops, something went wrong.