Skip to content

Commit 010ed99

Browse files
committed
fix: Fix SWRInfiniteKeyLoader
1 parent 8dca860 commit 010ed99

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/visitor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export class SWRVisitor extends ClientSideBaseVisitor<
203203
types.push(`export type SWRInfiniteKeyLoader<Data = unknown, Variables = unknown> = (
204204
index: number,
205205
previousPageData: Data | null
206-
) => Variables | null;`)
206+
) => Partial<Variables> | null;`)
207207
}
208208

209209
return `${types.join('\n')}

tests/swr.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ export type SdkWithHooks = ReturnType<typeof getSdkWithHooks>;`
288288
`export type SWRInfiniteKeyLoader<Data = unknown, Variables = unknown> = (
289289
index: number,
290290
previousPageData: Data | null
291-
) => Variables | null;
291+
) => Partial<Variables> | null;
292292
export function getSdkWithHooks(client: GraphQLClient, withWrapper: SdkFunctionWrapper = defaultWrapper) {
293293
const sdk = getSdk(client, withWrapper);
294294
const utilsForInfinite = {

0 commit comments

Comments
 (0)