Setup Graphql Code Generator
codegen.yaml
Using Graphql Code Generator and the library graphql-request we setup type safe and easy Graphql calls in Remix.
In the project root, create the file codegen.yaml
schema:- http://localhost:8080/v1/graphql:headers:x-hasura-admin-secret: ${HASURA_ADMIN_SECRET}documents: "./app/**/*.graphql"generates:./app/graphql/generated.ts:plugins:- typescript- typescript-operations- typescript-graphql-request
Did you find this page helpful?
Start with GraphQL on Hasura for Free
- Build apps and APIs 10x faster
- Built-in authorization and caching
- 8x more performant than hand-rolled APIs