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

Bug with evaluation of null values in comparision expressions in v1.3.4-beta.2 #6467

Closed
onikienko opened this issue Jan 20, 2021 · 3 comments

Comments

@onikienko
Copy link

According to the documentation:

If in any comparision expression a null (or undefined) value is passed, the expression currently gets reduced to {}

I have such quiery:

query Items($itemId: Int) {
  item(where: {id: {_lt: $itemId}}) {
    id
    name
  }
}

Querry value {itemId: null} or undefined.

I expect that where will be evaluated to the where: {} as described in the documentation. Instead, I have an error expected a 32-bit integer for type "Int", but found null.

This bug appears with v1.3.4-beta.2 for me. On stable, it worked as expected.

Possible related to #6459

@onikienko
Copy link
Author

onikienko commented Jan 20, 2021

Looks like the answer may be found here #704 (comment)

Strange to see such kind of changes in a patch update.

@tirumaraiselvan
Copy link
Contributor

Sorry about this! But this was actually causing serious problems for mutations where {} to true was deleting all the rows in the table. Also, the overall behaviour seemed opposite of expectation since passing null into a variable would hardly mean "everything" but variables accidentally becoming undefined was quite common.

We will highlight this in the changelog and make proper notifications before hitting stable. Thanks for the feedback.

@onikienko
Copy link
Author

I understand the reason for this update. And agree.

semver is kind of standard currently. Especially in the js community. So having breaking changes in the patch update may be a surprise.

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

2 participants