Skip to content

Commit 4c96970

Browse files
committed
default reactQuery to v4
1 parent fa5aea0 commit 4c96970

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

packages/ts-codegen/src/commands/generate.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default async (argv) => {
6464
type: 'list',
6565
name: 'version',
6666
message: 'which react-query version?',
67-
default: 'v3',
67+
default: 'v4',
6868
choices: ['v3', 'v4']
6969
},
7070
{

packages/wasm-ast-types/src/context/context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export const defaultOptions: RenderOptions = {
115115
reactQuery: {
116116
enabled: false,
117117
optionalClient: false,
118-
version: 'v3',
118+
version: 'v4',
119119
mutations: false,
120120
camelize: true,
121121
queryKeys: false

packages/wasm-ast-types/src/react-query/react-query.spec.ts

+16-8
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ import {
99
createReactQueryMutationHooks,
1010
} from './react-query'
1111
import { expectCode, makeContext } from '../../test-utils';
12-
import { createMessageBuilderClass } from '../message-builder';
13-
14-
const execCtx = makeContext(execute_msg);
15-
const queryCtx = makeContext(query_msg);
1612

1713
it('createReactQueryHooks', () => {
1814
expectCode(t.program(
1915
createReactQueryHooks(
2016
{
21-
context: queryCtx,
17+
context: makeContext(query_msg, {
18+
reactQuery: {
19+
version: 'v3',
20+
}
21+
}),
2222
queryMsg: query_msg,
2323
contractName: 'Sg721',
2424
QueryClient: 'Sg721QueryClient'
@@ -29,6 +29,7 @@ it('createReactQueryHooks', () => {
2929
{
3030
context: makeContext(query_msg, {
3131
reactQuery: {
32+
version: 'v3',
3233
optionalClient: true
3334
}
3435
}),
@@ -84,7 +85,11 @@ it('createReactQueryHooks', () => {
8485
expectCode(t.program(
8586
createReactQueryMutationHooks(
8687
{
87-
context: execCtx,
88+
context: makeContext(execute_msg, {
89+
reactQuery: {
90+
version: 'v3'
91+
}
92+
}),
8893
execMsg: execute_msg,
8994
contractName: 'Sg721',
9095
ExecuteClient: 'Sg721Client',
@@ -93,11 +98,14 @@ it('createReactQueryHooks', () => {
9398
});
9499

95100
it('ownership', () => {
96-
const ownershipCtx = makeContext(ownership);
97101
expectCode(t.program(
98102
createReactQueryMutationHooks(
99103
{
100-
context: ownershipCtx,
104+
context: makeContext(ownership, {
105+
reactQuery: {
106+
version: 'v3'
107+
}
108+
}),
101109
execMsg: ownership,
102110
contractName: 'Ownership',
103111
ExecuteClient: 'OwnershipClient',

0 commit comments

Comments
 (0)