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

fix(datastore-v1): correct the filter predicate logic applied to optional fields #3485

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

5d
Copy link
Member

@5d 5d commented Jan 27, 2024

Issue #

Description

The GraphQL filter predication not working properly on optional field. It always return false on optional field with value nil.

General Checklist

  • Added new tests to cover change, if needed
  • Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • All integration tests pass
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Documentation update for the change if required
  • PR title conforms to conventional commit style
  • New or updated tests include Given When Then inline code documentation and are named accordingly testThing_condition_expectation()
  • If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@5d 5d force-pushed the 5d/graphql-filter-on-optional-field-v1 branch from 671f0e9 to 9a0ccf6 Compare January 27, 2024 03:53
@5d 5d marked this pull request as ready for review January 29, 2024 20:17
@5d 5d requested a review from a team as a code owner January 29, 2024 20:17
XCTAssertFalse(evaluation)
XCTAssertTrue(evaluation)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] let's add either a test comment or improve the test name to testBooltruenotEqualBoolNil it's not immediately obvious that the instance has a nil Bool due to the default parameter value. Here and other tests that have similar changes

@5d 5d requested a review from lawmicha February 5, 2024 19:27
@5d 5d merged commit 27be191 into v1 Feb 5, 2024
17 checks passed
@5d 5d deleted the 5d/graphql-filter-on-optional-field-v1 branch February 5, 2024 20:09
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

Successfully merging this pull request may close these issues.

2 participants