mirror of
https://github.com/atulmy/gql-query-builder.git
synced 2026-04-25 23:55:55 +03:00
[GH-ISSUE #62] Default mutation adapter ignores variable name #38
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/gql-query-builder#38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @platformjb on GitHub (Jan 8, 2022).
Original GitHub issue: https://github.com/atulmy/gql-query-builder/issues/62
When generating a mutation and passing in an array of options, the
namefield is ignored for variables:Mutation generation:
Expected output:
Actual output:
When provided, the variable
nameshould be used as input to each mutation, rather than the key. The problematic code appears to be:github.com/atulmy/gql-query-builder@485e7db7e7/src/adapters/DefaultMutationAdapter.ts (L49-L57)The
queryDataNameAndArgumentMapinsrc/Utils.tscould be used to solve the issue, as it already handlesname.