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

Change Mutation widget behavior #112

Merged
merged 2 commits into from Oct 6, 2018

Conversation

Projects
2 participants
@Igor1201

Igor1201 commented Oct 4, 2018

Make Mutation result initially return loading=false, and stream a loading=true just after runMutation is called.

This way we can rely on result.loading to, for instance, build a different widget while mutation loading.

Change Mutation widget behavior
Make Mutation result initially return loading=false, and stream a loading=true when runMutation is called.
@HofmannZ

LGTM

@HofmannZ HofmannZ added the bug label Oct 6, 2018

@HofmannZ HofmannZ added this to In progress in Open Scrum via automation Oct 6, 2018

@HofmannZ HofmannZ added this to the 1.0.0 milestone Oct 6, 2018

@HofmannZ HofmannZ merged commit d0dffd3 into zino-app:next Oct 6, 2018

2 checks passed

GPG All commits have a verified GPG signature
WIP ready for review
Details

Open Scrum automation moved this from In progress to Done Oct 6, 2018

rafaelring added a commit to rafaelring/graphql-flutter that referenced this pull request Oct 11, 2018

Fix mutation calling onCompleted for loading state
After the introduction of the initial loading state to false on PR zino-app#112, the first emission of the observableQuery observable is a query result with the `loading: true`. The unexpected side effect of this change is that the `onCompleted`callback, which listens only to the first emission, would be called only for the loading state change and not for the query response itself.
This PR changes the `onCompleted` subscription to only call the method and cancel the subscription after the loading changes back to false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment