hey-api / openapi-ts

🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more. Support: @mrlubos
https://heyapi.dev
Other
1.43k stars 106 forks source link

feat: Add support for mutation-specific options #1137

Closed BierDav closed 1 month ago

BierDav commented 1 month ago

Use case:

You have one class let's call it ApiMutatations that calls all the createMutations once and stores it in a variable for later use. But you don't want to mess around with the default api, because when you use solid-js for example it's a lot more clean to use Contexts instead of global variables which might not have been configured (interceptors attached) already.

In our ApiMutations class we want to ensure that the correct Client is preconfigured, unfortunately until now, this was impossible. This small change covers this use case.

stackblitz[bot] commented 1 month ago

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: 80632ad5e658840a662c668a25313db59afb2e00

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------------- | ----- | | @hey-api/openapi-ts | Patch |

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

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hey-api-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 10, 2024 1:28pm
vercel[bot] commented 1 month ago

Deployment failed with the following error:

The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.
codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 8.33333% with 11 lines in your changes missing coverage. Please review.

Project coverage is 80.53%. Comparing base (39d83e2) to head (80632ad). Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...napi-ts/src/plugins/@tanstack/query-core/plugin.ts 8.33% 11 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1137 +/- ## ========================================== - Coverage 80.60% 80.53% -0.07% ========================================== Files 107 107 Lines 11732 11742 +10 Branches 1238 1238 ========================================== Hits 9456 9456 - Misses 2273 2283 +10 Partials 3 3 ``` | [Flag](https://app.codecov.io/gh/hey-api/openapi-ts/pull/1137/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hey-api) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/hey-api/openapi-ts/pull/1137/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hey-api) | `80.53% <8.33%> (-0.07%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=hey-api#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

pkg-pr-new[bot] commented 1 month ago

Open in Stackblitz

pnpm add https://pkg.pr.new/@hey-api/client-axios@1137
pnpm add https://pkg.pr.new/@hey-api/client-fetch@1137
pnpm add https://pkg.pr.new/@hey-api/openapi-ts@1137

commit: 80632ad