mirror of
https://github.com/atulmy/gql-query-builder.git
synced 2026-04-25 23:55:55 +03:00
[GH-ISSUE #49] mutation - variable with null value #124
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#124
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 @honzahk on GitHub (Sep 16, 2020).
Original GitHub issue: https://github.com/atulmy/gql-query-builder/issues/49
consider this code server-side
and this code client-side
now if you print out the mutation,
textvariable hasObjecttypethe reason is obvious,
gql-query-buildercannot determine the type when justnullis provided - it might be any type.if you send this mutation to the server-side, in response you get error
server-side does not know type
Object; moreover the type coming from client-side (infered bygql-query-builder) has to correspond with the type defined on server-side (in graphql schema)by now, i use workaround by specifing the variable type explicitly
is this workaround alright or is there a better way?
i cannot think of any other ways, as it is impossible to know the intended type when just
nullis provided.thanks in advance!
@Devorein commented on GitHub (Sep 24, 2020):
Yes that is the only way to accurately say what the type of that variable is in a query