개요
GraphQL Code Generator is a tool for generating code out of a GraphQL schema and GraphQL operations (query
/mutation
/subscription
).
GraphQL 스키마와 GraphQL operations 작성 후 graphql-codegen을 실행하면 훅으로 만들어준다.
- 추천 스니펫
# codegen.yml overwrite: true schema: - ${REACT_APP_GRAPHQL_API_URL} # GraphQL 서버 documents: 'src/graphql/**/*.graphql' generates: src/generated/graphql.tsx: plugins: - 'typescript' - 'typescript-operations' - 'typescript-react-apollo'