-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Since 2.6.0, FetchPolicy and react-apollo types that depend on it are broken #4847
Comments
Same issue. Does this mean |
It does work, only the types are mistaken 🙂 |
Because they happen at build time, type errors are in a fundamentally different category than runtime errors. We reserve the right to adjust our types from time to time, and we rely on TypeScript to communicate those changes to developers. Type errors may require some action (hence this note in CHANGELOG.md) but they communicate worthwhile information and are always worth fixing. If you're not ready to deal with type-level changes, please use a package-lock.json or yarn.lock file to pin the exact versions of your dependencies. Should help with #4847, along with the recent release of [email protected], which includes this change to use WatchQueryFetchPolicy: apollographql/react-apollo@63c2185
Thanks for reporting this issue, as we certainly did not intend this change to be so surprising. That said, this type change is meaningful, and adjusting your code to accommodate the new types (if necessary) is a good idea. I've just released Please feel free to reopen this issue (or open a new issue) if the problem persists after updating to |
Here's the note from
|
Thanks that is perfect! Just wanted to make sure no other third parties I'm not aware of (react-apollo or others) made use of this as well 🙂 Have a great day! |
Should we then file an issue against The issue is that |
@alamothe a new version of react-apollo has been released, you should be able to update and the problem will be gone |
Intended outcome:
<Query fetchPolicy="cache-and-network" />
should be valid.Actual outcome:
This change: cf069bc#diff-88b34d7add139a9c0e7d4c2b1944a8dc
broke all external types that depend on FetchPolicy, e.g.
used by the
Query
class.How to reproduce the issue:
Update apollo-client and write
<Query fetchPolicy="cache-and-network" />
in a typescript project.Versions
The text was updated successfully, but these errors were encountered: