-
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 subscribeToMore
function to useBackgroundQuery
, useQueryRefHandlers
, and useLoadableQuery
#11923
Conversation
🦋 Changeset detectedLatest commit: 0688353 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 📦
|
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
return { refetch, fetchMore }; | ||
const subscribeToMore: SubscribeToMoreFunction<TData, TVariables> = | ||
React.useCallback( | ||
(options) => internalQueryRef.observable.subscribeToMore(options), |
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.
We have this in soooo many places now... Suggestion: don't we just want to do bind(this)
calls in the ObservableQuery
constructor and remove these blocks from what feels like a hundred places?
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.
You're right! This is much better 🙂 141a0e1
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.
Looks good! :)
…in suspense hooks
30ceea5
to
141a0e1
Compare
subscribeToMore
function to useBackgroundQuery
and useQueryRefHandlers
subscribeToMore
function to useBackgroundQuery
, useQueryRefHandlers
, and useLoadableQuery
Closes #11818
Adds support for
subscribeToMore
inuseBackgroundQuery
,useLoadableQuery
, anduseQueryRefHandlers
that was previously missing. This was available inuseSuspenseQuery
but not in the other three hooks.