We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hot Chocolate
14.3.0
https://github.com/maartenkools/hc-fusion-duplicate-vars/tree/main
Start the Server and Gateway projects from the sample repo, and execute the following query:
query getItems($groupId: String! = "groupId") { items(groupId: $groupId) { values(groupId: $groupId) } }
The server has the following schema:
type Query { items(groupId: String): [Item!]! } type Item { values(groupId: String!): [String!]! }
Key point is that groupId is optional for the items query, while it's mandatory for values.
groupId
items
values
The query executes successfully (in case of the repo, an empty array is returned)
An error occurs:
Using HC 13.9.7:
{ "errors": [ { "message": "An item with the same key has already been added. Key: groupId", "extensions": { "code": "HC0012" } } ] }
Using HC 14.3.0 and up:
{ "errors": [ { "message": "Cannot return null for non-nullable field.", "locations": [ { "line": 2, "column": 3 } ], "path": [ "items" ], "extensions": { "code": "HC0018" } }, { "message": "An item with the same key has already been added. Key: groupId", "extensions": { "code": "HC0012" } } ] }
In both cases the following query plan is generated:
{ "queryPlan": { "document": "query getItems($groupId: String! = \"groupId\") { items(groupId: $groupId) { values(groupId: $groupId) } }", "operation": "getItems", "rootNode": { "type": "Sequence", "nodes": [{ "type": "Resolve", "subgraph": "Subgraph", "document": "query getItems_1($groupId: String! = \"groupId\", $groupId: String = \"groupId\") { items(groupId: $groupId) { values(groupId: $groupId) } }", "selectionSetId": 0, "forwardedVariables": [{ "variable": "groupId" }, { "variable": "groupId" } ] }, { "type": "Compose", "selectionSetIds": [ 0 ] } ] } } }
Possibly related to #7365?
The text was updated successfully, but these errors were encountered:
This issue is fixed with the new variable batching in fusion 15.
Sorry, something went wrong.
Hot Chocolate 14 already implements this new protocol but the current fusion implementation is not yet taking advantage of this.
No branches or pull requests
Product
Hot Chocolate
Version
14.3.0
Link to minimal reproduction
https://github.com/maartenkools/hc-fusion-duplicate-vars/tree/main
Steps to reproduce
Start the Server and Gateway projects from the sample repo, and execute the following query:
The server has the following schema:
Key point is that
groupId
is optional for theitems
query, while it's mandatory forvalues
.What is expected?
The query executes successfully (in case of the repo, an empty array is returned)
What is actually happening?
An error occurs:
Using HC 13.9.7:
Using HC 14.3.0 and up:
In both cases the following query plan is generated:
Relevant log output
Additional context
Possibly related to #7365?
The text was updated successfully, but these errors were encountered: