Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

refetchQueries only refetches a single query #1897

Closed
wmertens opened this issue Apr 5, 2018 · 2 comments
Closed

refetchQueries only refetches a single query #1897

wmertens opened this issue Apr 5, 2018 · 2 comments

Comments

@wmertens
Copy link
Contributor

wmertens commented Apr 5, 2018

Intended outcome:

After a mutation, the refetchQueries prop is used and all queries that have matching names are refetched.

Actual outcome:

After a mutation, the refetchQueries prop is used and the first query for each matching name is refetched.

How to reproduce the issue:

I don't have time to create a reproduction right now, I'm hoping this rings a bell, if not I can create a repro.

Basically, we have several queries with the same name that have slightly different fields, eg. query foo { foo { id bar } } and query foo { foo { id meep } }. Since v2.1 of react-apollo, only one of those queries gets updated.

Version

It used to work before.

@wmertens
Copy link
Contributor Author

wmertens commented Apr 5, 2018

I should add that changing the name of the queries and adding it to the refetchQueries works around the problem, but I do believe it should not be necessary.

@hwillson
Copy link
Member

hwillson commented Sep 6, 2019

React Apollo has been refactored to use React Hooks behind the scenes for everything, which means a lot has changed since this issue was opened (and a lot of outstanding issues have been resolved). We'll close this issue off, but please let us know if you're still encountering this problem using React Apollo >= 3.1.0. Thanks!

@hwillson hwillson closed this as completed Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants