Skip to content

Commit 596c3e8

Browse files
authored
Merge pull request #2726 from hey-api/chore/changeset-fix-3
Chore/changeset fix 3
2 parents 683dd22 + 28142d8 commit 596c3e8

File tree

3 files changed

+59
-17
lines changed

3 files changed

+59
-17
lines changed

.changeset/pretty-deers-change.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refactor(config): replace 'off' with null to disable options
66

77
### Updated `output` options
88

9-
We made the `output` configuration more consistent by using `null` to represent disabled options. This change does not affect boolean options.
9+
We made the `output` configuration more consistent by using `null` to represent disabled options. [This change](https://heyapi.dev/openapi-ts/migrating#updated-output-options) does not affect boolean options.
1010

1111
```js
1212
export default {

.changeset/refactor-pinia-colada-query.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,44 @@ feat(pinia-colada): query options use `defineQueryOptions`
77
### Updated Pinia Colada query options
88

99
Pinia Colada query options now use `defineQueryOptions` to improve reactivity support. Instead of calling the query options function, you can use one of the [following approaches](https://heyapi.dev/openapi-ts/migrating#updated-pinia-colada-query-options).
10+
11+
#### No params
12+
13+
```ts
14+
useQuery(getPetsQuery);
15+
```
16+
17+
#### Constant
18+
19+
```ts
20+
useQuery(getPetByIdQuery, () => ({
21+
path: {
22+
petId: 1,
23+
},
24+
}));
25+
```
26+
27+
#### Reactive
28+
29+
```ts
30+
const petId = ref<number | null>(1);
31+
32+
useQuery(getPetByIdQuery, () => ({
33+
path: {
34+
petId: petId.value,
35+
},
36+
}));
37+
```
38+
39+
#### Properties
40+
41+
```ts
42+
const petId = ref<number | null>(1);
43+
44+
useQuery(() => ({
45+
...getPetByIdQuery({
46+
path: { petId: petId.value as number },
47+
}),
48+
enabled: () => petId.value != null,
49+
}));
50+
```

packages/openapi-ts/CHANGELOG.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ We ship a dedicated TypeScript renderer for `.ts` files. This release improves t
6262

6363
- fix(parser): bump support for OpenAPI 3.1.2 ([#2667](https://github.com/hey-api/openapi-ts/pull/2667)) ([`3511fb8`](https://github.com/hey-api/openapi-ts/commit/3511fb88cbe6b767b631af16336cb6c0722c3ff8)) by [@mrlubos](https://github.com/mrlubos)
6464

65-
- fix(config): add `output.fileName` option
65+
- fix(config): add `output.fileName` option ([#2664](https://github.com/hey-api/openapi-ts/pull/2664)) ([`e1ede9c`](https://github.com/hey-api/openapi-ts/commit/e1ede9cabf52b5bbcb9195570deff58db8f43dbb)) by [@mrlubos](https://github.com/mrlubos)
6666

6767
## File Name
6868

@@ -80,7 +80,7 @@ export default {
8080

8181
By default, we append every file name with a `.gen` suffix to highlight it's automatically generated. You can customize or disable this suffix using the `fileName.suffix` option.
8282

83-
````js
83+
```js
8484
export default {
8585
input: 'hey-api/backend', // sign up at app.heyapi.dev
8686
output: {
@@ -90,9 +90,10 @@ export default {
9090
path: 'src/client',
9191
},
9292
};
93-
``` ([#2664](https://github.com/hey-api/openapi-ts/pull/2664)) ([`e1ede9c`](https://github.com/hey-api/openapi-ts/commit/e1ede9cabf52b5bbcb9195570deff58db8f43dbb)) by [@mrlubos](https://github.com/mrlubos)
93+
```
9494

9595
- fix(axios): remove duplicate `baseURL` when using relative values ([#2624](https://github.com/hey-api/openapi-ts/pull/2624)) ([`8ffceec`](https://github.com/hey-api/openapi-ts/commit/8ffceec89fe471d4e14df17a172f3d5a254eb819)) by [@Ben-Pfirsich](https://github.com/Ben-Pfirsich)
96+
9697
### Updated Dependencies:
9798
- @hey-api/[email protected]
9899

@@ -184,23 +185,23 @@ This option has been removed to provide a more consistent API across plugins. We
184185

185186
- [#2505](https://github.com/hey-api/openapi-ts/pull/2505) [`97c57f6`](https://github.com/hey-api/openapi-ts/commit/97c57f68af1f907f278707fb526289c73b33ea89) Thanks [@SebastiaanWouters](https://github.com/SebastiaanWouters)! - feat(parser): add Hooks API
186187

187-
### Added Hooks API
188+
### Added Hooks API
188189

189-
This release adds the [Hooks API](https://heyapi.dev/openapi-ts/configuration/parser#hooks), giving you granular control over which operations generate queries and mutations. As a result, we tightened the previous behavior and POST operations no longer generate queries by default. To preserve the old behavior, add a custom matcher.
190+
This release adds the [Hooks API](https://heyapi.dev/openapi-ts/configuration/parser#hooks), giving you granular control over which operations generate queries and mutations. As a result, we tightened the previous behavior and POST operations no longer generate queries by default. To preserve the old behavior, add a custom matcher.
190191

191-
```js
192-
export default {
193-
input: 'hey-api/backend', // sign up at app.heyapi.dev
194-
output: 'src/client',
195-
parser: {
196-
hooks: {
197-
operations: {
198-
isQuery: (op) => (op.method === 'post' ? true : undefined),
199-
},
192+
```js
193+
export default {
194+
input: 'hey-api/backend', // sign up at app.heyapi.dev
195+
output: 'src/client',
196+
parser: {
197+
hooks: {
198+
operations: {
199+
isQuery: (op) => (op.method === 'post' ? true : undefined),
200200
},
201201
},
202-
};
203-
````
202+
},
203+
};
204+
```
204205

205206
### Patch Changes
206207

0 commit comments

Comments
 (0)