Last active
December 3, 2021 10:14
-
-
Save eddsaura/e4cd25081d9e4013f787da1c3d396606 to your computer and use it in GitHub Desktop.
Installation of graphql-codegen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Obviously before we need graphql | |
yarn add graphql | |
// Installation | |
yarn add -D @graphql-codegen/cli @graphql-codegen/typescript @graphql-codegen/typescript-operations @graphql-codegen/introspection @graphql-codegen/typescript-react-apollo | |
// Initiate | |
yarn graphql-codegen init | |
// script | |
"generate": "graphql-codegen --config codegen.yml | |
/** | |
* codegen.yml | |
**/ | |
overwrite: true | |
schema: "https://url.with.schema/graphql/" | |
documents: "graphql/**/*.ts" | |
generates: | |
generated/graphql.tsx: | |
plugins: | |
- "typescript" | |
- "typescript-operations" | |
- "typescript-react-apollo" | |
./graphql.schema.json: | |
plugins: | |
- "introspection" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment