graphql-ppx
graphql-ppx copied to clipboard
Type error setting nullable integer field to null
In Hasura, a nullable field order
can be set to null with this mutation:
mutation ($id: String!) {
update_table_by_pk(pk_columns: {id: $id}, _set: {order: null}) {
id
}
}
But in Reason we're getting: Invalid argument. Expected "Int" but received "Null!".
A workaround is to use a nullable parameter and simply omit it when calling makeVariables:
mutation ($id: String!, $nullableInt: Int) {
update_table_by_pk(pk_columns: {id: $id}, _set: {order: $nullableInt}) {
id
}
}