-
Notifications
You must be signed in to change notification settings - Fork 2.7k
start work on the migration guide #12836
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
Conversation
|
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 33 new, 63 changed, 8 removedBuild ID: 9f91b341d93c945871fdbdc8 URL: https://www.apollographql.com/docs/deploy-preview/9f91b341d93c945871fdbdc8 |
commit: |
size-limit report 📦
|
94314ad to
d1de53d
Compare
| Local state management (using `@client` fields) has been moved out into the `LocalState` class. | ||
| This allows for users that don't use local state to save on bundle size. It you use `@client` directives, either with `TypePolicy` `read` fields or with `resolvers`, you need to create a new `LocalState` instance and pass it to the `ApolloClient` constructor. | ||
| If you fail to do so, during development an error will be thrown, and in production, results might be less predictable. (Jerel to add more context about consequences here.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jerelmiller pointing your attention here :)
jerelmiller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still actively working on a few changes, but I'll go ahead and approve this so we can merge as soon as we fix any remaining typos.
| ### Explicitly provide `HttpLink` | ||
| > This change is performed by the codemod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it :)
| ### Errors as guaranteed error-like objects | ||
| Apollo Client 4 guarantees that the `error` property is an `ErrorLike` object, an object with a `message` and `name` property. This avoids the need to check the type of `error` before consuming it. To make such a guarantee, thrown non-error types are wrapped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Apollo Client 4 guarantees that the `error` property is an `ErrorLike` object, an object with a `message` and `name` property. This avoids the need to check the type of `error` before consuming it. To make such a guarantee, thrown non-error types are wrapped. | |
| Apollo Client 4 guarantees that the `error` property is an `ErrorLike` object, an object with a `message` and `name` property. This avoids the need to check the type of `error` before consuming it. To make such a guarantee, thrown non-error-like values are wrapped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know the next paragraph repeats it, but type is a very ambiguous concept we probably shouldn't bring up here :)
Closes #12294