Graphql Codegen - No QueryClient set
Does anyone know why I would be getting this? I'm using
@graphql-codegen/typescript-react-query version 4.0.1. It's just a single TS file with all of the hooks generated for me. I'm importing the hook on a Next.js app that is using <QueryClientProvider>, but it's complaining about the generated file from graphql codegen not being wrapped in a client provider?
2 Replies
continuing-cyan•4y ago
very likely different versions of react-query floating around that have their own context. is that package already using tanstack-query ?
correct-apricotOP•4y ago
yeah, you can specify if you want legacy mode (react-query) or not (tanstack-query). I have it using tanstack-query
I think it's because of my monorepo setup. I'm using a pnpm workspace, so the generated TS file from
graphql-codegen lives in a separate package from my Next.js app