Skip to content

Commit 4f57d84

Browse files
committed
fix: adjustments
1 parent d4fbbbc commit 4f57d84

File tree

21 files changed

+69
-151
lines changed

21 files changed

+69
-151
lines changed

docs/openapi-ts/plugins/tanstack-query.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,49 @@ export default {
472472

473473
You can customize the naming and casing pattern for `mutationOptions` functions using the `.name` and `.case` options.
474474

475+
:::
476+
477+
## Meta Function Customization
478+
479+
The TanStack Query plugin supports custom meta functions that allow you to generate any metadata you want for your operations.
480+
481+
::: code-group
482+
483+
```ts [example]
484+
export default {
485+
input: 'https://get.heyapi.dev/hey-api/backend',
486+
output: 'src/client',
487+
plugins: [
488+
{
489+
name: '@tanstack/react-query',
490+
queryOptions: {
491+
meta: (operation) => ({
492+
// ... your meta object
493+
}),
494+
},
495+
},
496+
],
497+
};
498+
```
499+
500+
```js [config]
501+
export default {
502+
input: 'https://get.heyapi.dev/hey-api/backend',
503+
output: 'src/client',
504+
plugins: [
505+
// ...other plugins
506+
{
507+
name: '@tanstack/react-query',
508+
queryOptions: {
509+
meta: (operation) => ({
510+
// ... your meta object
511+
}),
512+
},
513+
},
514+
],
515+
};
516+
```
517+
475518
## API
476519

477520
You can view the complete list of options in the [UserConfig](https://github.com/hey-api/openapi-ts/blob/main/packages/openapi-ts/src/plugins/@tanstack/react-query/types.d.ts) interface.

packages/openapi-ts-tests/main/test/plugins/@tanstack/__snapshots__/3.1.x/plugins/@tanstack/core/types.ts

Lines changed: 0 additions & 118 deletions
This file was deleted.

packages/openapi-ts-tests/main/test/plugins/@tanstack/__snapshots__/3.1.x/plugins/@tanstack/index.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
export type { Auth } from '../core/auth';
2-
export type { QuerySerializerOptions } from '../core/bodySerializer';
1+
// This file is auto-generated by @hey-api/openapi-ts
2+
export * from './types.gen';
3+
export * from './sdk.gen';';
34
export {
45
formDataBodySerializer,
56
jsonBodySerializer,

0 commit comments

Comments
 (0)