Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error setting nullable integer field to null #217

Open
nireno opened this issue Nov 5, 2020 · 0 comments
Open

Type error setting nullable integer field to null #217

nireno opened this issue Nov 5, 2020 · 0 comments

Comments

@nireno
Copy link

nireno commented Nov 5, 2020

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
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant