-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(router): allow operation name propagation (#1394)
- Loading branch information
Showing
13 changed files
with
339 additions
and
8 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
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
147 changes: 147 additions & 0 deletions
147
router-tests/testdata/fixtures/query_plans/response_with_query_plan_operation_name.json
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,147 @@ | ||
{ | ||
"data": { | ||
"products": [ | ||
{ | ||
"__typename": "Consultancy", | ||
"lead": { | ||
"__typename": "Employee", | ||
"id": 1, | ||
"derivedMood": "HAPPY" | ||
}, | ||
"isLeadAvailable": false | ||
}, | ||
{ | ||
"__typename": "Cosmo" | ||
}, | ||
{ | ||
"__typename": "SDK" | ||
} | ||
] | ||
}, | ||
"extensions": { | ||
"queryPlan": { | ||
"version": "1", | ||
"kind": "Sequence", | ||
"children": [ | ||
{ | ||
"kind": "Single", | ||
"fetch": { | ||
"kind": "Single", | ||
"subgraphName": "employees", | ||
"subgraphId": "0", | ||
"fetchId": 0, | ||
"query": "query Requires__employees__0 {\n products {\n __typename\n ... on Consultancy {\n lead {\n __typename\n id\n }\n __typename\n upc\n }\n }\n}" | ||
} | ||
}, | ||
{ | ||
"kind": "Parallel", | ||
"children": [ | ||
{ | ||
"kind": "Single", | ||
"fetch": { | ||
"kind": "BatchEntity", | ||
"path": "[email protected]", | ||
"subgraphName": "mood", | ||
"subgraphId": "6", | ||
"fetchId": 1, | ||
"dependsOnFetchIds": [ | ||
0 | ||
], | ||
"representations": [ | ||
{ | ||
"kind": "@key", | ||
"typeName": "Employee", | ||
"fragment": "fragment Key on Employee {\n __typename\n id\n}" | ||
} | ||
], | ||
"query": "query Requires__mood__1($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n currentMood\n }\n }\n}" | ||
} | ||
}, | ||
{ | ||
"kind": "Single", | ||
"fetch": { | ||
"kind": "BatchEntity", | ||
"path": "[email protected]", | ||
"subgraphName": "availability", | ||
"subgraphId": "5", | ||
"fetchId": 2, | ||
"dependsOnFetchIds": [ | ||
0 | ||
], | ||
"representations": [ | ||
{ | ||
"kind": "@key", | ||
"typeName": "Employee", | ||
"fragment": "fragment Key on Employee {\n __typename\n id\n}" | ||
} | ||
], | ||
"query": "query Requires__availability__2($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n isAvailable\n }\n }\n}" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "Parallel", | ||
"children": [ | ||
{ | ||
"kind": "Single", | ||
"fetch": { | ||
"kind": "BatchEntity", | ||
"path": "[email protected]", | ||
"subgraphName": "employees", | ||
"subgraphId": "0", | ||
"fetchId": 3, | ||
"dependsOnFetchIds": [ | ||
0, | ||
1 | ||
], | ||
"representations": [ | ||
{ | ||
"kind": "@requires", | ||
"typeName": "Employee", | ||
"fieldName": "derivedMood", | ||
"fragment": "fragment Requires_for_derivedMood on Employee {\n currentMood\n}" | ||
}, | ||
{ | ||
"kind": "@key", | ||
"typeName": "Employee", | ||
"fragment": "fragment Key on Employee {\n __typename\n id\n}" | ||
} | ||
], | ||
"query": "query Requires__employees__3($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n derivedMood\n }\n }\n}" | ||
} | ||
}, | ||
{ | ||
"kind": "Single", | ||
"fetch": { | ||
"kind": "BatchEntity", | ||
"path": "products", | ||
"subgraphName": "employees", | ||
"subgraphId": "0", | ||
"fetchId": 4, | ||
"dependsOnFetchIds": [ | ||
0, | ||
2 | ||
], | ||
"representations": [ | ||
{ | ||
"kind": "@requires", | ||
"typeName": "Consultancy", | ||
"fieldName": "isLeadAvailable", | ||
"fragment": "fragment Requires_for_isLeadAvailable on Consultancy {\n lead {\n isAvailable\n }\n}" | ||
}, | ||
{ | ||
"kind": "@key", | ||
"typeName": "Consultancy", | ||
"fragment": "fragment Key on Consultancy {\n __typename\n upc\n}" | ||
} | ||
], | ||
"query": "query Requires__employees__4($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Consultancy {\n __typename\n isLeadAvailable\n }\n }\n}" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
147 changes: 147 additions & 0 deletions
147
...tests/testdata/fixtures/query_plans/response_with_query_plan_operation_name_and_path.json
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,147 @@ | ||
{ | ||
"data": { | ||
"products": [ | ||
{ | ||
"__typename": "Consultancy", | ||
"lead": { | ||
"__typename": "Employee", | ||
"id": 1, | ||
"derivedMood": "HAPPY" | ||
}, | ||
"isLeadAvailable": false | ||
}, | ||
{ | ||
"__typename": "Cosmo" | ||
}, | ||
{ | ||
"__typename": "SDK" | ||
} | ||
] | ||
}, | ||
"extensions": { | ||
"queryPlan": { | ||
"version": "1", | ||
"kind": "Sequence", | ||
"children": [ | ||
{ | ||
"kind": "Single", | ||
"fetch": { | ||
"kind": "Single", | ||
"subgraphName": "employees", | ||
"subgraphId": "0", | ||
"fetchId": 0, | ||
"query": "query Requires__employees__0__query {\n products {\n __typename\n ... on Consultancy {\n lead {\n __typename\n id\n }\n __typename\n upc\n }\n }\n}" | ||
} | ||
}, | ||
{ | ||
"kind": "Parallel", | ||
"children": [ | ||
{ | ||
"kind": "Single", | ||
"fetch": { | ||
"kind": "BatchEntity", | ||
"path": "[email protected]", | ||
"subgraphName": "mood", | ||
"subgraphId": "6", | ||
"fetchId": 1, | ||
"dependsOnFetchIds": [ | ||
0 | ||
], | ||
"representations": [ | ||
{ | ||
"kind": "@key", | ||
"typeName": "Employee", | ||
"fragment": "fragment Key on Employee {\n __typename\n id\n}" | ||
} | ||
], | ||
"query": "query Requires__mood__1__query_products_Frag0Consultancy_lead($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n currentMood\n }\n }\n}" | ||
} | ||
}, | ||
{ | ||
"kind": "Single", | ||
"fetch": { | ||
"kind": "BatchEntity", | ||
"path": "[email protected]", | ||
"subgraphName": "availability", | ||
"subgraphId": "5", | ||
"fetchId": 2, | ||
"dependsOnFetchIds": [ | ||
0 | ||
], | ||
"representations": [ | ||
{ | ||
"kind": "@key", | ||
"typeName": "Employee", | ||
"fragment": "fragment Key on Employee {\n __typename\n id\n}" | ||
} | ||
], | ||
"query": "query Requires__availability__2__query_products_Frag0Consultancy_lead($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n isAvailable\n }\n }\n}" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"kind": "Parallel", | ||
"children": [ | ||
{ | ||
"kind": "Single", | ||
"fetch": { | ||
"kind": "BatchEntity", | ||
"path": "[email protected]", | ||
"subgraphName": "employees", | ||
"subgraphId": "0", | ||
"fetchId": 3, | ||
"dependsOnFetchIds": [ | ||
0, | ||
1 | ||
], | ||
"representations": [ | ||
{ | ||
"kind": "@requires", | ||
"typeName": "Employee", | ||
"fieldName": "derivedMood", | ||
"fragment": "fragment Requires_for_derivedMood on Employee {\n currentMood\n}" | ||
}, | ||
{ | ||
"kind": "@key", | ||
"typeName": "Employee", | ||
"fragment": "fragment Key on Employee {\n __typename\n id\n}" | ||
} | ||
], | ||
"query": "query Requires__employees__3__query_products_Frag0Consultancy_lead($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Employee {\n __typename\n derivedMood\n }\n }\n}" | ||
} | ||
}, | ||
{ | ||
"kind": "Single", | ||
"fetch": { | ||
"kind": "BatchEntity", | ||
"path": "products", | ||
"subgraphName": "employees", | ||
"subgraphId": "0", | ||
"fetchId": 4, | ||
"dependsOnFetchIds": [ | ||
0, | ||
2 | ||
], | ||
"representations": [ | ||
{ | ||
"kind": "@requires", | ||
"typeName": "Consultancy", | ||
"fieldName": "isLeadAvailable", | ||
"fragment": "fragment Requires_for_isLeadAvailable on Consultancy {\n lead {\n isAvailable\n }\n}" | ||
}, | ||
{ | ||
"kind": "@key", | ||
"typeName": "Consultancy", | ||
"fragment": "fragment Key on Consultancy {\n __typename\n upc\n}" | ||
} | ||
], | ||
"query": "query Requires__employees__4__query_products($representations: [_Any!]!){\n _entities(representations: $representations){\n ... on Consultancy {\n __typename\n isLeadAvailable\n }\n }\n}" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
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
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.