-
Notifications
You must be signed in to change notification settings - Fork 187
Open
Description
Describe the bug
Unused pageParamKey in file https://github.com/dotansimha/graphql-code-generator/blob/master/packages/plugins/typescript/react-query/src/fetcher-graphql-request.ts
I think this:
return `export const useInfinite${operationName} = <
TData = ${operationResultType},
TError = ${this.visitor.config.errorType}
>(
pageParamKey: keyof ${operationVariablesTypes},
client: GraphQLClient,
${variables},
${options},
headers?: RequestInit['headers']
) =>
${hookConfig.infiniteQuery.hook}<${operationResultType}, TError, TData>(
${generateInfiniteQueryKey(node, hasRequiredVariables)},
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(client, ${documentVariableName}, {...variables, ...(metaData.pageParam ?? {})}, headers)(),
options
);`;should be change to:
return `export const useInfinite${operationName} = <
TData = ${operationResultType},
TError = ${this.visitor.config.errorType}
>(
pageParamKey: keyof ${operationVariablesTypes},
client: GraphQLClient,
${variables},
${options},
headers?: RequestInit['headers']
) =>
${hookConfig.infiniteQuery.hook}<${operationResultType}, TError, TData>(
${generateInfiniteQueryKey(node, hasRequiredVariables)},
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(client, ${documentVariableName}, {...variables, [pageParamKey]: metaData.pageParam }, headers)(),
options
);`;patrykszydlowski, liliiakhr, cmi23, narthur and saalihou
Metadata
Metadata
Assignees
Labels
No labels