graphql-let
graphql-let copied to clipboard
using generated types and document without importing hook breaks HMR codegen
Hey man!
Great work on this plugin, smooths over so much codegen pain.
I'm having an issue where I'm using a with-typescript-graphql setup on nextjs. I'm using getStaticProps and so can't call useFooQuery hooks from there.
Instead, I import the FooQuery and FooQueryVariables types and FooDocument and pass them to my apollo client:
import { FooQuery, FooQueryVariables } from '../graphql/foo.graphql';
import { FooDocument } from '../__generated__/graphql/foo.graphql';
// and in getStaticProps
await prismicClient.query<FooQuery, FooQueryVariables>({
query: FooDocument,
})
All good, but now since useFooQuery isn't referenced, when I edit foo.graphql, webpack doesn't pick up the changes.
HMR only seems to trigger when I import the hook.