-
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
Initial implementation of fetchMore
#472
Conversation
@@ -16,8 +16,13 @@ import { | |||
|
|||
import assign = require('lodash.assign'); | |||
|
|||
export interface FetchMoreOptions { | |||
updateQuery: (previousQueryResult: any, options: any) => any; |
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.
I don't think options should be "any" here
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.
yeah, I should change these to have the precise fields.
If you need any help, just ask me @Slava, even if it's just writing tests! |
The initial implementation completed. Have two tests covering all base cases. Still need docs, and some things. @stubailo might want to look at the following "problem" in the API: The reducer function receives two arguments:
The ways we can improve it include:
Either way, it will be a breaking change to mutations. Resolution: Keep it as is for now. We can make another breaking change later if needed. The reasoning is to keep the wrapped objects, in case there is a different way of handling a query with errors. (cc @stubailo) |
Hey @Slava ! Any progress on this ? Do you need any help ? |
Forces a big refactor of how we update query results in the store. This way, we can share the same logic between multiple features in the future: - mutation results - fetchMore results - subscription results
@rricard Hi! No, I think this implementation is complete. We are working on merging it right now. |
ok, I'll try that right away and give you feedback since the react-apollo PR seems to be there too! |
TODO:
Design:
fetchMore
method on an observable queryfetchMore
query always are fetched from the serverfetchMore
is responsible for merging the new result into the existing query results