From 74daeb6fbc2e24933c2d7fd41c2abf2ab72f9c3c Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Thu, 31 Mar 2022 20:21:12 +0300 Subject: [PATCH] Use GraphQL Config for GraphQL Codegen --- .graphqlrc.yml | 10 ++++++++++ codegen.yml | 12 ------------ graphql.config.json | 4 ---- package.json | 2 +- 4 files changed, 11 insertions(+), 17 deletions(-) create mode 100644 .graphqlrc.yml delete mode 100644 codegen.yml delete mode 100644 graphql.config.json diff --git a/.graphqlrc.yml b/.graphqlrc.yml new file mode 100644 index 0000000..9b2dcfb --- /dev/null +++ b/.graphqlrc.yml @@ -0,0 +1,10 @@ +schema: ./graphql/schema/schema.graphql +documents: ./app/**/*.{graphql,js,ts,jsx,tsx} +extensions: + codegen: + generates: + ./app/gql: + preset: gql-tag-operations-preset + hooks: + afterOneFileWrite: + - prettier --write diff --git a/codegen.yml b/codegen.yml deleted file mode 100644 index d0b7ef6..0000000 --- a/codegen.yml +++ /dev/null @@ -1,12 +0,0 @@ -overwrite: true -schema: "./graphql/schema/schema.graphql" -documents: - - "app/**/*.tsx" - - "!app/gql/**/*" -generates: - ./app/gql/: - preset: gql-tag-operations-preset - -hooks: - afterOneFileWrite: - - prettier --write diff --git a/graphql.config.json b/graphql.config.json deleted file mode 100644 index f31d150..0000000 --- a/graphql.config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "schema": ["./graphql/schema/schema.graphql"], - "documents": ["./app/**/*.{graphql,js,ts,jsx,tsx}"] -} diff --git a/package.json b/package.json index e71ac32..d6ff384 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ }, "scripts": { "prepare": "husky install", - "codegen": "graphql-codegen --config codegen.yml", + "codegen": "graphql-codegen", "codegen:fetch": "node --no-warnings scripts/fetchGraphQLSchema ", "codegen:watch": "yarn run codegen -- --watch" }