Skip to content

Commit

Permalink
Merge pull request #1137 from BierDav/main
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlubos authored Oct 10, 2024
2 parents 39d83e2 + 80632ad commit 61d1e15
Show file tree
Hide file tree
Showing 14 changed files with 989 additions and 650 deletions.
5 changes: 5 additions & 0 deletions .changeset/real-kangaroos-enjoy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hey-api/openapi-ts': patch
---

Add support for passing mutation specific options to `<operation_id>Mutation(options)`
14 changes: 12 additions & 2 deletions packages/openapi-ts/src/plugins/@tanstack/query-core/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
import { relativeModulePath } from '../../../generate/utils';
import { isOperationParameterRequired } from '../../../openApi';
import { getOperationKey } from '../../../openApi/common/parser/operation';
import type { Client } from '../../../types/client';
import type {
Client,
Method,
Model,
Operation,
Expand Down Expand Up @@ -1143,6 +1143,13 @@ export const handler: PluginHandler<
});

const expression = compiler.arrowFunction({
parameters: [
{
isRequired: false,
name: 'options',
type: `Partial<${typeData}>`,
},
],
statements: [
compiler.constVariable({
expression: compiler.objectExpression({
Expand All @@ -1154,7 +1161,7 @@ export const handler: PluginHandler<
multiLine: true,
parameters: [
{
name: 'options',
name: 'localOptions',
},
],
statements: [
Expand All @@ -1170,6 +1177,9 @@ export const handler: PluginHandler<
{
spread: 'options',
},
{
spread: 'localOptions',
},
{
key: 'throwOnError',
value: true,
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 61d1e15

Please sign in to comment.