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

Decouple fetchMore logic from ObservableQuery #646

Closed
micimize opened this issue May 20, 2020 · 3 comments
Closed

Decouple fetchMore logic from ObservableQuery #646

micimize opened this issue May 20, 2020 · 3 comments

Comments

@micimize
Copy link
Collaborator

We should extract the fundamentals of fetchMore into a helper function, so that a QueryResult from client.query can easily be used with it https://github.com/zino-app/graphql-flutter/blob/6c188cbb1b287b2c1f7135c41ef4c0f1fe952886/packages/graphql/lib/src/core/observable_query.dart#L139-L198

related to #372

@micimize
Copy link
Collaborator Author

https://gist.github.com/micimize/cd51edf60d0c3f4cd04c2b78218890f1 is untested, but it should hopefully work for users not using ObservableQuery

@sokolej79
Copy link

Good decision, because now it is only available from client.watchQuery.
And if anybody use only client with own query widgets as I do it is impossible to get fetchMore from client.query and I don need client.watchQuery for ordinary infinity list scrolling.
Just note aside for flutter Query widget and why I dont use Query widget, it is rebuilding to often.
I think that is because of StreamBuilder, this line:
stream=observableQuery.stream
Stream should not be provided directly to StreamBuilder, that is why it is rebuilding to often. Should be "cached" onInit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants