You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.
To get around this I have been doing something like:
moduleSubscriber {
[@react.component]
letmake= (~results) => {
(subResults, _) =ApolloHooks.useSubscription(...);switch subResults {
|Data(newResults) => <StatelessRenderer results=newResults />
|_=> <StatelessRenderer results=results />
}
}
}
// parent component will query, then child will either pass data through // or re-render on subscription update
[@react.component]
letmake=()=> {
(results, _) =ApolloHooks.useQuery(...);
<Subscriber results=results />
}
But this has the major problem that each subscription push most contain all the data required to re-render a components, as opposed to an individual item to add, subtract, etc.
The text was updated successfully, but these errors were encountered:
I am pretty sure it is supported, here is where subscribeToMore is defined as a return value queryResult from useQuery. Can you check whether it will work for you?
Thanks, that looks very promising! Not sure how I missed it when I looked through the library. I'll close this issue once I confirm it's working -- will also try to do a pull request with some extra documentation.
Does the library support loading additional data from a subscription after a query is executed? Subscriptions are difficult to use efficiently without this functionality: https://www.apollographql.com/docs/react/data/subscriptions/#subscribetomore
To get around this I have been doing something like:
But this has the major problem that each subscription push most contain all the data required to re-render a components, as opposed to an individual item to add, subtract, etc.
The text was updated successfully, but these errors were encountered: