This course is no longer maintained and may be out-of-date. While it remains available for reference, its content may not reflect the latest updates, best practices, or supported features.
Setup Graphql Code Generator
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

