Closed thangngoc89 closed 6 years ago
fetchMore
is probably the way to go, but it would be interesting to see a Component based approach...
We are currently calling query
on the ApolloClient, which returns a promise. If we want to have the update
fetchMore
... functions back from the query we should call watchQuery
which returns an ObservableQuery
Since Reason React has a Subscriptions helper now, we should find a nice way to implement it
I guess I need to do my homework to see how React Apollo does this. I'm using RR's state as a store for storing all the fetched data. It's hacky and probably inefficient because Apollo client already has its cache store.
yep, Apollo Client does all that work. We should just bind all the things
Thank you for the tip. I'm gonna work on it.
Any update on this? I'm converting a react project that uses fetchMore and am wondering how to implement this.
We're binding react apollo 2.1 Query and Mutations components, so it will be fixed at that moment. Should be released very soon
bindings to react-apollo 2.1 have been published 🎉
It contains the fetchMore
prop, as react-apollo 2.1 does: https://github.com/apollographql/reason-apollo/blob/master/src/graphql-types/ReasonApolloQuery.re#L19
I've been looking for create an infinite loading component. But it's very hard to do it with the current declarative API. I ended up cloning reason-apollo (again) to implement such feature. So I want to open an issue to discuss with you guys first before working on a PR. I see 2 possible ways to solve this: