mirror of
https://github.com/atulmy/gql-query-builder.git
synced 2026-04-25 23:55:55 +03:00
[GH-ISSUE #61] Attempting multiple queries with the same variable name does not work as expected #39
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#39
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 @aijorgenson on GitHub (Sep 10, 2021).
Original GitHub issue: https://github.com/atulmy/gql-query-builder/issues/61
I'm attempting a fairly simple multi-query where I want to retrieve multiple counts from a single request with varying values. (i.e. get the count of fruit for several different statuses)
Given the example query below:
The following query will be built out:
This is an issue because the
wherevariable is intentionally different between queries; however, the last query's value for the variable is used for the entire query set. Is this a bug or is there some sort of workaround I could do?@aijorgenson commented on GitHub (Sep 10, 2021):
After struggling for a few I found the following solution in another issue:
https://github.com/atulmy/gql-query-builder/issues/48#issuecomment-762530333
The solution was to call each variable a unique name, i.e.
where_1andwhere_2, then inside of the variable definename: 'where'