-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add support for skip
option to useSuspenseQuery
and useBackgroundQuery
#10940
Conversation
🦋 Changeset detectedLatest commit: 322f355 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
size-limit report 📦
|
…hen options change
This PR is ready to go except for the types. I will need the changes from #10951 to ensure the types are correct. |
Just merged #10951 and merged the release branch back into this one to kick off the tests again. Is this one ready for review now? Edit: just saw we'll need to adjust the types for |
@alessbell this PR should be ready to go now. I'd like to take a pass at refactoring in general in a future PR so if you see opportunities for consolidation/refactoring, feel free to point them out. Thanks! |
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.
It's great to have this feature parity with useQuery
finally in place in the new Suspense hooks 🎉🎉
Re: any refactoring we may want to do between useBackgroundQuery
/useSuspenseQuery
- since there's a small amount of duplication, I'm good with leaving them as they are for now until it becomes a bit clearer how they can/should share code (if at all). 🚀
expectTypeOf(explicit).toEqualTypeOf<VariablesCaseData | undefined>(); | ||
expectTypeOf(explicit).not.toEqualTypeOf<VariablesCaseData>(); | ||
|
||
// TypeScript is too smart and using a `const` or `let` boolean variable |
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.
Good to know!
} | ||
|
||
// Assign the updated fetch policy after our validation since `standby` is | ||
// not a supported fetch policy on its own without the use of `skip`. |
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.
👍
Closes #10532
Adds support for the
skip
option touseSuspenseQuery
anduseBackgroundQuery
.Checklist: