Setup GraphQL Code Generator (#74)

* chore: add types of schema

* Ease codegen use on FE

* chore: ignore prettier in generated files

* lint: generated files

* feature: strongly type filter of query

* chore: ignore generated files in prettier

* chore: eslint ignore generated files

---------

Co-authored-by: Sammy Teillet <sammy.teillet@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Charles Bochet
2023-04-25 17:25:30 +02:00
committed by GitHub
parent a93c92c65c
commit ae7bad65ca
13 changed files with 13478 additions and 30 deletions

View File

@ -12,6 +12,7 @@ HASURA_AUTH_GRAPHQL_URL: http://twenty-hasura:8080/v1/graphql
FRONT_REACT_APP_API_URL=http://localhost:8080
FRONT_REACT_APP_AUTH_URL=http://localhost:4000
FRONT_HASURA_GRAPHQL_ENDPOINT=http://twenty-hasura:8080/v1/graphql
SERVER_HASURA_EVENT_HANDLER_SECRET_HEADER: secret
SERVER_DATABASE_URL: postgres://postgres:postgrespassword@postgres:5432/default

View File

@ -27,6 +27,9 @@ front-coverage: ##
front-storybook: ##
@docker-compose exec twenty-front sh -c "npm run storybook"
front-graphql-generate: ##
@docker-compose exec twenty-front sh -c "npm run graphql-generate"
## Hasura
hasura-logs: ##

View File

@ -8,8 +8,10 @@ services:
- "3001:3001"
- "6006:6006"
environment:
- REACT_APP_API_URL=${FRONT_REACT_APP_API_URL}
- REACT_APP_AUTH_URL=${FRONT_REACT_APP_AUTH_URL}
REACT_APP_API_URL: ${FRONT_REACT_APP_API_URL}
REACT_APP_AUTH_URL: ${FRONT_REACT_APP_AUTH_URL}
HASURA_GRAPHQL_ENDPOINT: ${FRONT_HASURA_GRAPHQL_ENDPOINT}
HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET}
volumes:
- ../../front:/app/front
- twenty_node_modules_front:/app/front/node_modules

View File

@ -2,7 +2,10 @@ FROM node:18.16.0-alpine as front
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh && \
apk add libc6-compat
apk add libc6-compat \
apk add python3 \
apk add make \
apk add g++
WORKDIR /app/front