Sign up for Hasura Newsletter
Loading...

Setup Graphql Code Generator

githubcodegen.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
  • ArrowBuild apps and APIs 10x faster
  • ArrowBuilt-in authorization and caching
  • Arrow8x more performant than hand-rolled APIs
Promo
footer illustration
Brand logo
© 2024 Hasura Inc. All rights reserved
Github
Titter
Discord
Facebook
Instagram
Youtube
Linkedin