-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle mutations containing
@defer
(#2102)
Fix #2099 to validate the primary part of a request with `@defer`, we reconstruct a partial query by walking through the query plan. The code responsible for that was not detecting mutations. while the PR in the current state fixes the issue, I'd like to refactor a bit so that we do not special case query and mutation (which will be annoying if we add subscription at some point), and moving the query reconstruction elsewhere, to work directly on the query instead of the query plan
- Loading branch information
Showing
4 changed files
with
147 additions
and
9 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
15 changes: 15 additions & 0 deletions
15
...s/snapshots/apollo_router__services__supergraph_service__tests__query_reconstruction.snap
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,15 @@ | ||
--- | ||
source: apollo-router/src/services/supergraph_service.rs | ||
expression: stream.next_response().await.unwrap() | ||
--- | ||
{ | ||
"errors": [ | ||
{ | ||
"message": "invalid type for variable: 'userId'", | ||
"extensions": { | ||
"type": "ValidationInvalidTypeVariable", | ||
"name": "userId" | ||
} | ||
} | ||
] | ||
} |
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