Skip to content

Commit f9ee302

Browse files
committed
fix: Fix issue that don't work pagination in useSWRInfinite
1 parent cb17207 commit f9ee302

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/visitor.ts

+1
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ ${
222222
return key ? [id, ...key] : null
223223
},
224224
generateFetcher: <Query = unknown, Variables = unknown>(query: (variables: Variables) => Promise<Query>, variables?: Variables) => (
225+
id: string,
225226
fieldName: keyof Variables,
226227
fieldValue: Variables[typeof fieldName]
227228
) => query({ ...variables, [fieldName]: fieldValue } as Variables)

tests/swr.spec.ts

+1
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ export function getSdkWithHooks(client: GraphQLClient, withWrapper: SdkFunctionW
300300
return key ? [id, ...key] : null
301301
},
302302
generateFetcher: <Query = unknown, Variables = unknown>(query: (variables: Variables) => Promise<Query>, variables?: Variables) => (
303+
id: string,
303304
fieldName: keyof Variables,
304305
fieldValue: Variables[typeof fieldName]
305306
) => query({ ...variables, [fieldName]: fieldValue } as Variables)

0 commit comments

Comments
 (0)