Skip to content

Commit d27af0d

Browse files
committed
Add changeset
1 parent 98e9d8c commit d27af0d

6 files changed

Lines changed: 30 additions & 13 deletions

File tree

.changeset/shaky-queens-sell.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@graphql-codegen/typescript-react-query': patch
3+
'@graphql-codegen/typescript-solid-query': patch
4+
---
5+
6+
Query keys should be shared between suspense and non-suspense hooks to ensure consistent state
7+
management and synchronization, preventing discrepancies and maintaining a single source of truth
8+
for query invalidation.

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Setup env
2929
uses: the-guild-org/shared-config/setup@main
3030
with:
31-
nodeVersion: 18
31+
nodeVersion: 24
3232
- name: Prettier Check
3333
run: yarn prettier:check
3434
dev-tests:
@@ -83,10 +83,10 @@ jobs:
8383
strategy:
8484
matrix:
8585
os: [ubuntu-latest] # remove windows to speed up the tests
86-
node_version: [18, 20, 22]
86+
node_version: [20, 22, 24]
8787
graphql_version: [15, 16]
8888
include:
89-
- node-version: 18
89+
- node-version: 20
9090
os: windows-latest
9191
graphql_version: 16
9292
steps:

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
stable:
9+
uses: the-guild-org/shared-config/.github/workflows/release-stable.yml@main
10+
with:
11+
releaseScript: release
12+
nodeVersion: 24
13+
secrets:
14+
githubToken: ${{ secrets.GITHUB_TOKEN }}
15+
npmToken: ${{ secrets.NPM_TOKEN }}

packages/plugins/typescript/react-query/src/fetcher.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,7 @@ export abstract class FetcherRenderer {
135135
>(${argumentsResult}) => {
136136
${implHookOuter}
137137
return ${query.getHook()}<${operationResultType}, TError, TData>(
138-
${this.generateQueryFormattedParameters(
139-
this.generateQueryKey(config),
140-
implFetcher,
141-
)}
138+
${this.generateQueryFormattedParameters(this.generateQueryKey(config), implFetcher)}
142139
)};`;
143140
};
144141

packages/plugins/typescript/react-query/tests/__snapshots__/react-query.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,7 +1439,7 @@ export const useSuspenseTestQuery = <
14391439
14401440
return useSuspenseQuery<TestQuery, TError, TData>(
14411441
{
1442-
queryKey: variables === undefined ? ['testSuspense'] : ['testSuspense', variables],
1442+
queryKey: variables === undefined ? ['test'] : ['test', variables],
14431443
queryFn: fetcher<TestQuery, TestQueryVariables>(dataSource.endpoint, dataSource.fetchParams || {}, TestDocument, variables),
14441444
...options
14451445
}
@@ -1478,7 +1478,7 @@ export const useSuspenseInfiniteTestQuery = <
14781478
(() => {
14791479
const { queryKey: optionsQueryKey, ...restOptions } = options;
14801480
return {
1481-
queryKey: optionsQueryKey ?? variables === undefined ? ['test.infiniteSuspense'] : ['test.infiniteSuspense', variables],
1481+
queryKey: optionsQueryKey ?? variables === undefined ? ['test.infinite'] : ['test.infinite', variables],
14821482
queryFn: (metaData) => fetcher<TestQuery, TestQueryVariables>(dataSource.endpoint, dataSource.fetchParams || {}, TestDocument, {...variables, ...(metaData.pageParam ?? {})})(),
14831483
...restOptions
14841484
}

packages/plugins/typescript/solid-query/src/fetcher.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,7 @@ export abstract class FetcherRenderer {
125125
>(${argumentsResult}) => {
126126
${implHookOuter}
127127
return ${query.getHook()}<${operationResultType}, TError, TData>(
128-
${this.generateQueryFormattedParameters(
129-
this.generateQueryKey(config),
130-
implFetcher,
131-
)}
128+
${this.generateQueryFormattedParameters(this.generateQueryKey(config), implFetcher)}
132129
)};`;
133130
};
134131

0 commit comments

Comments
 (0)