TypeScript GraphQL types can be generated in generated/graphql.tsx
by running yarn generate
. This command should be run if the Hasura GraphQL schema changes or a new GraphQL query/mutation was added to the frontend. Note that this command requires the Hasura server to be running locally.
- Add a new GraphQL query/mutation under the appropriate folder in
graphql
- Try to reuse common fragments under
graphql/fragments
or make your own if it can be used in multiple places
- Try to reuse common fragments under
- Generate types for your new frament/query/mutation with
yarn generate
- Make GraphQL requests with Apollo and the generated types