feat: Add support for mutation-specific options#1137
Conversation
|
|
🦋 Changeset detectedLatest commit: 80632ad The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Deployment failed with the following error: |
| parameters: [ | ||
| { | ||
| name: 'options', | ||
| name: 'localOptions', |
There was a problem hiding this comment.
Could you rename this to mutationOptions?
| name: 'localOptions', | |
| name: 'mutationOptions', |
| spread: 'options', | ||
| }, | ||
| { | ||
| spread: 'localOptions', |
There was a problem hiding this comment.
| spread: 'localOptions', | |
| spread: 'mutationOptions', |
There was a problem hiding this comment.
Yeah also though about that, I could and it would probably work, but I creates a naming collision with the local variable that is used for typing. A nice solution would be to add support for the as keyword of typescript, but I don't want to mess around with this selfmade solution
| }) => | ||
| compiler.arrayLiteralExpression({ |
There was a problem hiding this comment.
I assume this change was done while you were playing around with the code, mind reverting it?
There was a problem hiding this comment.
IntellIiJ complained, because of the redundant variable, I though I will just fix it. But of course I can revert it.
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| '@hey-api/openapi-ts': minor | |||
There was a problem hiding this comment.
Could you change the release type to patch? Just a preference for how I am currently versioning the package as this is a relatively tiny change
Change changeset level to patch
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
commit: |
Use case:
You have one class let's call it
ApiMutatationsthat calls all thecreateMutations 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 usesolid-jsfor 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
ApiMutationsclass we want to ensure that the correctClientis preconfigured, unfortunately until now, this was impossible. This small change covers this use case.