-
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.
Back out "Revert D54206758: [relay][PR] Validate edgeTypeName argumen…
…t points to an existing type" Reviewed By: tyao1 Differential Revision: D58677254 fbshipit-source-id: 70d98778daec367d77ba358dd12b68172bb7afbf
- Loading branch information
1 parent
6150200
commit 8badceb
Showing
15 changed files
with
349 additions
and
10 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
22 changes: 22 additions & 0 deletions
22
...ests/compile_relay_artifacts/fixtures/append-node-literal-edge-type-name-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,22 @@ | ||
==================================== INPUT ==================================== | ||
# expected-to-throw | ||
|
||
mutation appendNodeLiteralEdgeTypeNameInvalidCommentCreateMutation( | ||
$connections: [ID!]! | ||
$input: CommentCreateInput | ||
) { | ||
commentCreate(input: $input) { | ||
comment | ||
@appendNode(connections: $connections, edgeTypeName: "CommentEdge") { | ||
id | ||
} | ||
} | ||
} | ||
==================================== ERROR ==================================== | ||
✖︎ Expected the 'edgeTypeName' argument value on @appendNode to be the name of an object type. 'CommentEdge' does not refer to a known object type. Did you mean `CommentsEdge`, `Comment`, or `SegmentsEdge`? | ||
|
||
append-node-literal-edge-type-name-invalid.graphql:9:60 | ||
8 │ comment | ||
9 │ @appendNode(connections: $connections, edgeTypeName: "CommentEdge") { | ||
│ ^^^^^^^^^^^^^ | ||
10 │ id |
13 changes: 13 additions & 0 deletions
13
...tests/compile_relay_artifacts/fixtures/append-node-literal-edge-type-name-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,13 @@ | ||
# expected-to-throw | ||
|
||
mutation appendNodeLiteralEdgeTypeNameInvalidCommentCreateMutation( | ||
$connections: [ID!]! | ||
$input: CommentCreateInput | ||
) { | ||
commentCreate(input: $input) { | ||
comment | ||
@appendNode(connections: $connections, edgeTypeName: "CommentEdge") { | ||
id | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...pile_relay_artifacts/fixtures/append-node-literal-edge-type-name-not-object-type.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,22 @@ | ||
==================================== INPUT ==================================== | ||
# expected-to-throw | ||
|
||
mutation appendNodeLiteralEdgeTypeNameNotObjectTypeMutation( | ||
$connections: [ID!]! | ||
$input: CommentCreateInput | ||
) { | ||
commentCreate(input: $input) { | ||
comment | ||
@appendNode(connections: $connections, edgeTypeName: "Node") { | ||
id | ||
} | ||
} | ||
} | ||
==================================== ERROR ==================================== | ||
✖︎ Expected the 'edgeTypeName' argument value on @appendNode to be the name of an object type. 'Node' does not refer to a known object type. | ||
|
||
append-node-literal-edge-type-name-not-object-type.graphql:9:60 | ||
8 │ comment | ||
9 │ @appendNode(connections: $connections, edgeTypeName: "Node") { | ||
│ ^^^^^^ | ||
10 │ id |
13 changes: 13 additions & 0 deletions
13
...mpile_relay_artifacts/fixtures/append-node-literal-edge-type-name-not-object-type.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,13 @@ | ||
# expected-to-throw | ||
|
||
mutation appendNodeLiteralEdgeTypeNameNotObjectTypeMutation( | ||
$connections: [ID!]! | ||
$input: CommentCreateInput | ||
) { | ||
commentCreate(input: $input) { | ||
comment | ||
@appendNode(connections: $connections, edgeTypeName: "Node") { | ||
id | ||
} | ||
} | ||
} |
177 changes: 177 additions & 0 deletions
177
...sts/compile_relay_artifacts/fixtures/append-node-literal-edge-type-name-variable.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,177 @@ | ||
==================================== INPUT ==================================== | ||
mutation appendNodeLiteralEdgeTypeNameVariableMutation( | ||
$connections: [ID!]! | ||
$input: CommentCreateInput | ||
$edgeTypeName: String! | ||
) { | ||
commentCreate(input: $input) { | ||
comment | ||
@appendNode(connections: $connections, edgeTypeName: $edgeTypeName) { | ||
id | ||
} | ||
} | ||
} | ||
==================================== OUTPUT =================================== | ||
{ | ||
"fragment": { | ||
"argumentDefinitions": [ | ||
{ | ||
"defaultValue": null, | ||
"kind": "LocalArgument", | ||
"name": "connections" | ||
}, | ||
{ | ||
"defaultValue": null, | ||
"kind": "LocalArgument", | ||
"name": "edgeTypeName" | ||
}, | ||
{ | ||
"defaultValue": null, | ||
"kind": "LocalArgument", | ||
"name": "input" | ||
} | ||
], | ||
"kind": "Fragment", | ||
"metadata": null, | ||
"name": "appendNodeLiteralEdgeTypeNameVariableMutation", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": [ | ||
{ | ||
"kind": "Variable", | ||
"name": "input", | ||
"variableName": "input" | ||
} | ||
], | ||
"concreteType": "CommentCreateResponsePayload", | ||
"kind": "LinkedField", | ||
"name": "commentCreate", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"concreteType": "Comment", | ||
"kind": "LinkedField", | ||
"name": "comment", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "id", | ||
"storageKey": null | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
], | ||
"type": "Mutation", | ||
"abstractKey": null | ||
}, | ||
"kind": "Request", | ||
"operation": { | ||
"argumentDefinitions": [ | ||
{ | ||
"defaultValue": null, | ||
"kind": "LocalArgument", | ||
"name": "connections" | ||
}, | ||
{ | ||
"defaultValue": null, | ||
"kind": "LocalArgument", | ||
"name": "input" | ||
}, | ||
{ | ||
"defaultValue": null, | ||
"kind": "LocalArgument", | ||
"name": "edgeTypeName" | ||
} | ||
], | ||
"kind": "Operation", | ||
"name": "appendNodeLiteralEdgeTypeNameVariableMutation", | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": [ | ||
{ | ||
"kind": "Variable", | ||
"name": "input", | ||
"variableName": "input" | ||
} | ||
], | ||
"concreteType": "CommentCreateResponsePayload", | ||
"kind": "LinkedField", | ||
"name": "commentCreate", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"concreteType": "Comment", | ||
"kind": "LinkedField", | ||
"name": "comment", | ||
"plural": false, | ||
"selections": [ | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"kind": "ScalarField", | ||
"name": "id", | ||
"storageKey": null | ||
} | ||
], | ||
"storageKey": null | ||
}, | ||
{ | ||
"alias": null, | ||
"args": null, | ||
"filters": null, | ||
"handle": "appendNode", | ||
"key": "", | ||
"kind": "LinkedHandle", | ||
"name": "comment", | ||
"handleArgs": [ | ||
{ | ||
"kind": "Variable", | ||
"name": "connections", | ||
"variableName": "connections" | ||
}, | ||
{ | ||
"kind": "Variable", | ||
"name": "edgeTypeName", | ||
"variableName": "edgeTypeName" | ||
} | ||
] | ||
} | ||
], | ||
"storageKey": null | ||
} | ||
] | ||
}, | ||
"params": { | ||
"cacheID": "c6c4a56d7ea1db74c1935491b7a2e10a", | ||
"id": null, | ||
"metadata": {}, | ||
"name": "appendNodeLiteralEdgeTypeNameVariableMutation", | ||
"operationKind": "mutation", | ||
"text": null | ||
} | ||
} | ||
|
||
QUERY: | ||
|
||
mutation appendNodeLiteralEdgeTypeNameVariableMutation( | ||
$input: CommentCreateInput | ||
) { | ||
commentCreate(input: $input) { | ||
comment { | ||
id | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ests/compile_relay_artifacts/fixtures/append-node-literal-edge-type-name-variable.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,12 @@ | ||
mutation appendNodeLiteralEdgeTypeNameVariableMutation( | ||
$connections: [ID!]! | ||
$input: CommentCreateInput | ||
$edgeTypeName: String! | ||
) { | ||
commentCreate(input: $input) { | ||
comment | ||
@appendNode(connections: $connections, edgeTypeName: $edgeTypeName) { | ||
id | ||
} | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.