You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a Hasura generated schema I have this mutation:
# update data of the table: "task"updateTasks(
# append existing jsonb value of filtered columns with new jsonb value_append: task_append_input # delete the field or element with specified path (for JSON arrays, negative integers count from the end)_delete_at_path: task_delete_at_path_input # delete the array element with specified index (negative integers count from # the end). throws an error if top level container is not an array_delete_elem: task_delete_elem_input # delete key/value pair or string element. key/value pairs are matched based on their key value_delete_key: task_delete_key_input # increments the numeric columns with given value of the filtered values_inc: task_inc_input # prepend existing jsonb value of filtered columns with new jsonb value_prepend: task_prepend_input # sets the columns of the filtered rows to the given values_set: task_set_input # filter the rows which have to be updatedwhere: task_bool_exp!
): task_mutation_response
For this, the following function is generated by mst-gql:
The problem is that while _inc (of type task_inc_input) is defined as optional _inc: $inc somehow Hasura expects to have value for it in variables because it is mentioned among the updateTasks() parameters. In case of queries I didn't see this happen, only in mutations. Maybe mutation arguments have a different semantics than query arguments?
Anyways, I think it would be feasible to only generate arguments, which are set in variables. This needs runtime evaluation of the variables and based on that should be the graphql mutation string generated.
A similar mechanism is also implemented in #361, so I could fix this mutation issue as well.
The text was updated successfully, but these errors were encountered:
In a Hasura generated schema I have this mutation:
For this, the following function is generated by mst-gql:
Note that every argument from the graphql schema is listed in the generated
mutation updateTasks(...)
as arguments.When I try to use this function like this (I only want to set a specific value):
I get this error:
The problem is that while
_inc
(of typetask_inc_input
) is defined as optional_inc: $inc
somehow Hasura expects to have value for it invariables
because it is mentioned among theupdateTasks()
parameters. In case of queries I didn't see this happen, only in mutations. Maybe mutation arguments have a different semantics than query arguments?Anyways, I think it would be feasible to only generate arguments, which are set in
variables
. This needs runtime evaluation of thevariables
and based on that should be the graphql mutation string generated.A similar mechanism is also implemented in #361, so I could fix this mutation issue as well.
The text was updated successfully, but these errors were encountered: