Draft
Conversation
🦋 Changeset detectedLatest commit: 001df18 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Fixes #13123 Improves the return type of `client.query` to be smarter about the applied `errorPolicy`. The `data` and `error` properties now better reflect the expected runtime value for a given `errorPolicy`. This allow the removal of `undefined` checks or optional chaining for most uses of `client.query`. > [!NOTE] > The `ApolloClient.QueryResult` type is used in several places throughout the code base, most of which do not know the underlying `errorPolicy` applied (e.g. `refetchQueries`, which might have a mix of `ObservableQuery` instances with different error policies). As such, I left a fallback case that leaves the type as-is. You need to be explicit about an error policy in order to get the smarter types. --------- Co-authored-by: Lenz Weber-Tronic <lorenz.weber-tronic@apollographql.com>
✅ Docs preview has no changesThe preview was not built because there were no changes. Build ID: 586f0d646499419f38a32219 |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to release-4.2, this PR will be updated.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ `release-4.2` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run `changeset pre exit` on `release-4.2`.⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ # Releases ## @apollo/client@4.2.0-alpha.0 ### Minor Changes - [#13130](#13130) [`dd12231`](dd12231) Thanks [@jerelmiller](https://github.com/jerelmiller)! - Improve the accuracy of `client.query` return type to better detect the current `errorPolicy`. The `data` property is no longer nullable when the `errorPolicy` is `none`. This makes it possible to remove the `undefined` checks or optional chaining in most cases. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
Would it be possible to release another alpha which includes the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.