-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a41e2b
commit 7fe54cc
Showing
1 changed file
with
15 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
### Normalize "operation_name" value inside supergraph request ([Issue #5014](https://github.com/apollographql/router/issues/5014)) | ||
|
||
At present, the behavior of `request.body.operation_name` in Rhai scripts is such that it is a direct copy of `operationName` from the client request. | ||
So `request.body.operation_name` can be empty even if `query` contains a named query. For example: | ||
```json | ||
{ | ||
"query": "query OperationName { me { id } }" | ||
} | ||
``` | ||
In this case, `request.body.operation_name` was empty because the client didn't specify `operationName.` | ||
|
||
This behavior is very confusing to users who expect it to have an operation name if `query` contains a named query. | ||
After this change, `request.body.operation_name` will always default to the operation name extracted from parsed `query`. | ||
|
||
By [@IvanGoncharov](https://github.com/IvanGoncharov) in https://github.com/apollographql/router/pull/5008 |