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

Refetch queries #482

Merged
merged 10 commits into from
Aug 2, 2016
Merged

Refetch queries #482

merged 10 commits into from
Aug 2, 2016

Conversation

Poincare
Copy link
Contributor

@Poincare Poincare commented Jul 30, 2016

Added an invalidateQueries option to client.mutate as per #448.

TODO:

  • Update CHANGELOG.md with your change
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

Rebased on top of Slava's PR #472.

@davidwoody
Copy link
Contributor

This is great, I'm excited for this feature to get released! One quick thought: perhaps calling the option refetchQueries might add clarity to the behavior?

@Poincare Poincare force-pushed the invalidate_queries branch from 2323d97 to 60273fb Compare August 1, 2016 21:59
@Poincare
Copy link
Contributor Author

Poincare commented Aug 1, 2016

I think refetchQueries makes more sense. I'll go ahead and rename it to that.

@Poincare Poincare force-pushed the invalidate_queries branch from 90fc9f3 to 54cd999 Compare August 1, 2016 22:12
@Poincare
Copy link
Contributor Author

Poincare commented Aug 1, 2016

Rebased @stubailo

@stubailo stubailo changed the title Invalidate queries Refetch queries Aug 2, 2016
@@ -9,6 +9,7 @@ Expect active development and potentially significant breaking changes in the `0

- Fixed issue with `fragments` array for `updateQueries`. [PR #475](https://github.com/apollostack/apollo-client/pull/475) and [Issue #470](https://github.com/apollostack/apollo-client/issues/470).
- Add a new experimental feature to observable queries called `fetchMore`. It allows application developers to update the results of a query in the store by issuing new queries. We are currently testing this feature internally and we will document it once it is stable.
- Added an `invalidateQueries` option to `mutate`. The point is to just refetch certain queries on a mutation rather than having to manually specify how the result should be incorporated for each of them with `updateQueries`. [PR #482](https://github.com/apollostack/apollo-client/pull/482) and [Issue #448](https://github.com/apollostack/apollo-client/issues/448).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still says invalidateQueries

@stubailo
Copy link
Contributor

stubailo commented Aug 2, 2016

@Poincare looks great, but I think this might have a weird interaction with a thing Slava just added with the pagination PR.

@@ -558,25 +582,15 @@ export class QueryManager {
}
const resultBehaviors = [];

const queryIdsByName: { [name: string]: string[] } = {};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was from Slava's PR and I moved it

@Poincare Poincare force-pushed the invalidate_queries branch from 152d664 to 57a84b9 Compare August 2, 2016 20:57
@stubailo stubailo merged commit 3cdf457 into master Aug 2, 2016
@stubailo
Copy link
Contributor

stubailo commented Aug 2, 2016

@Poincare we should add docs for this.

@stubailo stubailo deleted the invalidate_queries branch September 20, 2016 03:42
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants