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

[SDK] Fix inferred partial field types, when using _and/_or filters in queries #22288

Merged
merged 10 commits into from May 3, 2024

Conversation

br41nslug
Copy link
Member

@br41nslug br41nslug commented Apr 22, 2024

Fixes #20633

Scope

What's changed:

  • The issue seems to have been with the complexity of the MergeOptional generic used before.
  • Added test case to catch this issue (hopefully, if vitest keeps working)
  • Renamed the tests to default naming since the typecheck.only setting is no longer working as expected with vitest.

Before
The inference of the entire query failed when adding conditional _and/_or filters resulting in no-schema fallback logic kicking in while it should be able to extract the fields.

Correct inference:
image

Failing inference:
image

Potential Risks / Drawbacks

  • Lorem ipsum dolor sit amet

Review Notes / Questions

  • I would like to lorem ipsum

Copy link

changeset-bot bot commented Apr 22, 2024

🦋 Changeset detected

Latest commit: 1971ef0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@directus/sdk Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@br41nslug br41nslug marked this pull request as ready for review April 22, 2024 18:11
@br41nslug br41nslug requested a review from paescuj April 24, 2024 11:20
@paescuj paescuj self-assigned this May 3, 2024
Copy link
Member

@paescuj paescuj left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@paescuj paescuj enabled auto-merge (squash) May 3, 2024 15:22
@paescuj paescuj merged commit 6bacead into main May 3, 2024
4 checks passed
@paescuj paescuj deleted the fix-20633 branch May 3, 2024 15:28
@github-actions github-actions bot added this to the Next Release milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[SDK] Unable to resolve inferred partial field types, when using _and/_or filters in queries
2 participants