openapi-typescript
openapi-typescript copied to clipboard
feat(swr-openapi): add custom error types to query builder
Changes
close #2136
Added a new Type Parameter, FetcherError, to createQueryHook, createImmutableHook, and createInfiniteHook.
It allows you to include FetcherError to the type of the error in the return value of useQuery.
By default, it is set to never to maintain backward compatibility.
Why this is needed is detailed in issue #2136 .
How to Review
To avoid breaking VSCode syntax highlighting, "<unique-key>" is assigned to a variable before being used in the type argument.
Checklist
- [x] Unit tests updated
- [ ]
docs/updated (if necessary) - [ ]
pnpm run update:examplesrun (only applicable for openapi-typescript)
Deploy Preview for openapi-ts failed.
| Name | Link |
|---|---|
| Latest commit | 98627826c0f1cb00b706fdb8e294a151696b0c52 |
| Latest deploy log | https://app.netlify.com/projects/openapi-ts/deploys/67a889e0904849000847392c |
⚠️ No Changeset found
Latest commit: 98627826c0f1cb00b706fdb8e294a151696b0c52
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Is there anything I should do?
This looks great, thank you! Great tests, too! Please add a changeset (see comment) and we can merge and release!
Actually since there’s been some time that’s passed since the PR has been open and we’ve been slow to review, I’ll just add the changeset manually so we can get a release out. Thanks!