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

Export client and subscribeToMore from useSuspenseQuery #10429

Closed
jerelmiller opened this issue Jan 11, 2023 · 1 comment · Fixed by #10450
Closed

Export client and subscribeToMore from useSuspenseQuery #10429

jerelmiller opened this issue Jan 11, 2023 · 1 comment · Fixed by #10450
Assignees

Comments

@jerelmiller
Copy link
Member

As explained in the PR, my initial goal with the API surface area of useSuspenseQuery was to keep it small and add to it as we have feedback throughout the alpha release process.

While working with useSuspenseQuery in the Spotify demo, I have added a subscription to be able to listen for the playback state to change. Because I'm fetching the initial data set with useSuspenseQuery, I want to be able to use subscribeToMore to start the subscription and easily update the cache with the results from the subscription.

As a workaround, I tried to write to the cache directly in combination with useSubscription, but the client property isn't exported from useSuspenseQuery, making this a touch more difficult. This is a property exported by useQuery, so it would make sense that useSuspenseQuery would do the same. This makes it easier to get access to the client to perform manual cache updates when needed.

@jerelmiller
Copy link
Member Author

Finished in #10450

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant