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

Feature: add ability to refetch certain queries imperatively #7431

Merged
merged 2 commits into from
Dec 11, 2020

Conversation

dannycochran
Copy link
Contributor

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests (WIP)

Relevant issue:
#7410

This is a WIP, I still need to write tests. But I wanted to start the convo about how this would look.

@apollo-cla
Copy link

@dannycochran: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

Copy link
Member

@benjamn benjamn left a comment

Choose a reason for hiding this comment

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

This is looking good! Thanks for adding tests. Just a couple of ideas to eliminate/consolidate even more code.

src/core/ApolloClient.ts Outdated Show resolved Hide resolved
src/core/QueryManager.ts Outdated Show resolved Hide resolved
@benjamn benjamn changed the base branch from main to release-3.4 December 11, 2020 18:10
@benjamn benjamn added this to the Release 3.4 milestone Dec 11, 2020
@benjamn benjamn merged commit bc7e533 into apollographql:release-3.4 Dec 11, 2020
benjamn added a commit that referenced this pull request Dec 12, 2020
@dannycochran dannycochran deleted the refetchQueries branch March 4, 2021 17:39
benjamn added a commit that referenced this pull request Apr 16, 2021
This is obviously a breaking change for client.refetchQueries, but that
method was introduced in PR #7431, targeting the release-3.4 branch.

Since Apollo Client v3.4 is still in beta, we still have room to rework
the signature of the client.refetchQueries method (introduced in #7431 and
released in @apollo/client@3.4.0-beta.3), not only adding significant new
functionality like options.updateCache and options.onQueryUpdated, but
also leaving room to add functionality more easily in the future, without
breaking backwards compatibility, since client.refetchQueries takes named
options and returns an object of named results, so adding new options or
returning new results never needs to be a breaking change.
benjamn added a commit that referenced this pull request May 1, 2021
This is obviously a breaking change for client.refetchQueries, but that
method was introduced in PR #7431, targeting the release-3.4 branch.

Since Apollo Client v3.4 is still in beta, we still have room to rework
the signature of the client.refetchQueries method (introduced in #7431 and
released in @apollo/client@3.4.0-beta.3), not only adding significant new
functionality like options.updateCache and options.onQueryUpdated, but
also leaving room to add functionality more easily in the future, without
breaking backwards compatibility, since client.refetchQueries takes named
options and returns an object of named results, so adding new options or
returning new results never needs to be a breaking change.
benjamn added a commit that referenced this pull request May 5, 2021
This is obviously a breaking change for client.refetchQueries, but that
method was introduced in PR #7431, targeting the release-3.4 branch.

Since Apollo Client v3.4 is still in beta, we still have room to rework
the signature of the client.refetchQueries method (introduced in #7431 and
released in @apollo/client@3.4.0-beta.3), not only adding significant new
functionality like options.updateCache and options.onQueryUpdated, but
also leaving room to add functionality more easily in the future, without
breaking backwards compatibility, since client.refetchQueries takes named
options and returns an object of named results, so adding new options or
returning new results never needs to be a breaking change.
benjamn added a commit that referenced this pull request May 11, 2021
This is obviously a breaking change for client.refetchQueries, but that
method was introduced in PR #7431, targeting the release-3.4 branch.

Since Apollo Client v3.4 is still in beta, we still have room to rework
the signature of the client.refetchQueries method (introduced in #7431 and
released in @apollo/client@3.4.0-beta.3), not only adding significant new
functionality like options.updateCache and options.onQueryUpdated, but
also leaving room to add functionality more easily in the future, without
breaking backwards compatibility, since client.refetchQueries takes named
options and returns an object of named results, so adding new options or
returning new results never needs to be a breaking change.
benjamn added a commit that referenced this pull request May 12, 2021
This is obviously a breaking change for client.refetchQueries, but that
method was introduced in PR #7431, targeting the release-3.4 branch.

Since Apollo Client v3.4 is still in beta, we still have room to rework
the signature of the client.refetchQueries method (introduced in #7431 and
released in @apollo/client@3.4.0-beta.3), not only adding significant new
functionality like options.updateCache and options.onQueryUpdated, but
also leaving room to add functionality more easily in the future, without
breaking backwards compatibility, since client.refetchQueries takes named
options and returns an object of named results, so adding new options or
returning new results never needs to be a breaking change.
benjamn added a commit that referenced this pull request May 12, 2021
This is obviously a breaking change for client.refetchQueries, but that
method was introduced in PR #7431, targeting the release-3.4 branch.

Since Apollo Client v3.4 is still in beta, we still have room to rework
the signature of the client.refetchQueries method (introduced in #7431 and
released in @apollo/client@3.4.0-beta.3), not only adding significant new
functionality like options.updateCache and options.onQueryUpdated, but
also leaving room to add functionality more easily in the future, without
breaking backwards compatibility, since client.refetchQueries takes named
options and returns an object of named results, so adding new options or
returning new results never needs to be a breaking change.
benjamn added a commit that referenced this pull request May 13, 2021
This is obviously a breaking change for client.refetchQueries, but that
method was introduced in PR #7431, targeting the release-3.4 branch.

Since Apollo Client v3.4 is still in beta, we still have room to rework
the signature of the client.refetchQueries method (introduced in #7431 and
released in @apollo/client@3.4.0-beta.3), not only adding significant new
functionality like options.updateCache and options.onQueryUpdated, but
also leaving room to add functionality more easily in the future, without
breaking backwards compatibility, since client.refetchQueries takes named
options and returns an object of named results, so adding new options or
returning new results never needs to be a breaking change.
benjamn added a commit that referenced this pull request May 18, 2021
This is obviously a breaking change for client.refetchQueries, but that
method was introduced in PR #7431, targeting the release-3.4 branch.

Since Apollo Client v3.4 is still in beta, we still have room to rework
the signature of the client.refetchQueries method (introduced in #7431 and
released in @apollo/client@3.4.0-beta.3), not only adding significant new
functionality like options.updateCache and options.onQueryUpdated, but
also leaving room to add functionality more easily in the future, without
breaking backwards compatibility, since client.refetchQueries takes named
options and returns an object of named results, so adding new options or
returning new results never needs to be a breaking change.
@hwillson hwillson removed this from the MM-2021-06 milestone Jul 29, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants