-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
feat: improve type-safety (like the queryOptions type-helper) #1672
Conversation
if (!params.length) { | ||
if (!params.length || isSuspenseQuery(type)) { | ||
if (options) { | ||
return `${queryConfig} ...queryOptions`; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because suspense queries don't expect to be passed the 'enabled' option (https://tanstack.com/query/latest/docs/framework/react/reference/useSuspenseQuery), which is passed a few lines down from here after this return statement.
This failed a test, I do not know why this test hasn't failed before these changes but I think it somehow triggered this existing bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note for the person reviewing this, you can resolve this after reading if you want.
looks like something is messed up with the build? |
Yes, it fails in the install stage. I think I may have found the cause: The same dependencies that fail the install were bumped in this commit from 7.1.1 to 7.2.0, but it seems the yarn.lock file was not updated accordingly. Maybe this is the reason this surfaced only now and not before, since this PR is from the fork I made. Would you like me to add the update to the lockfile? -- Of course i did not pay attention and clicked sync changes on my fork repo, without installing locally and committing locally, which would probably have caught this change earlier |
Yes please it was probably from last release on Monday. |
ok now run |
All good now! Will just let @soartec-lab or @anymaniax review |
Thank you! I would like to see this PR, but I need a few days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for nice update!
Status
READY
Description
Fix #1671
following the implementation described here:
https://tkdodo.eu/blog/the-query-options-api#datatag
note: this is the first PR I've opened, I would very much appreciate your feedback.
Related PRs
List related PRs against other branches:
Todos
Steps to Test or Reproduce
Outline the steps to test or reproduce the PR here.