React Query Configuration Error

Author: rayhankinanCreated Jul 2, 2025Updated Jul 2, 2025

I think both of these lines have mismatched types:

https://github.com/alan2207/bulletproof-react/blob/49c4249fd68ef2196151ef34cc2c68cb4fe81dc1/apps/nextjs-app/src/features/comments/api/get-comments.ts#L40

https://github.com/alan2207/bulletproof-react/blob/49c4249fd68ef2196151ef34cc2c68cb4fe81dc1/apps/nextjs-pages/src/features/comments/api/get-comments.ts#L46

Should both of these lines be defined as the following:

queryConfig?: InfiniteQueryConfig<typeof getInfiniteCommentsQueryOptions>

With InfiniteQueryConfig:

type InfiniteQueryConfig<T extends (...args: any[]) => any> = Omit<
  ReturnType<T>,
  "queryKey" | "queryFn" | "getNextPageParam" | "initialPageParam"
>;

Correct me if I'm wrong though

Source: alan2207/bulletproof-react