From a2721971ba82a6ba0e735bd06cf555a4c1bca84e Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 3 Feb 2020 23:08:26 +0100 Subject: webui: generate TS types for graphql queries --- webui/codegen.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'webui/codegen.yaml') diff --git a/webui/codegen.yaml b/webui/codegen.yaml index 8412b042..3cbcfb09 100644 --- a/webui/codegen.yaml +++ b/webui/codegen.yaml @@ -1,8 +1,31 @@ schema: '../graphql/schema/*.graphql' overwrite: true +documents: src/**/*.graphql generates: ./src/fragmentTypes.js: plugins: - fragment-matcher config: module: es2015 + ./src/gqlTypes.ts: + plugins: + - typescript + ./src/: + plugins: + - typescript-operations + - typescript-react-apollo + preset: near-operation-file + presetConfig: + extension: .generated.tsx + baseTypesPath: gqlTypes.ts + config: + withComponent: false + withHOC: false + withHooks: true + +config: + documentMode: documentNode + +hooks: + afterOneFileWrite: + - prettier --write -- cgit From 6a502c145bd8f2e2e1a9c0b103c11f0433c60737 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Tue, 4 Feb 2020 20:57:43 +0100 Subject: webui: convert bug list to typescript --- webui/codegen.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'webui/codegen.yaml') diff --git a/webui/codegen.yaml b/webui/codegen.yaml index 3cbcfb09..161fd1c7 100644 --- a/webui/codegen.yaml +++ b/webui/codegen.yaml @@ -12,6 +12,7 @@ generates: - typescript ./src/: plugins: + - add: '/* eslint-disable @typescript-eslint/no-unused-vars */' - typescript-operations - typescript-react-apollo preset: near-operation-file @@ -23,9 +24,6 @@ generates: withHOC: false withHooks: true -config: - documentMode: documentNode - hooks: afterOneFileWrite: - prettier --write -- cgit From 9ddcb4b09215f942cb7889f9756d426ad3c90253 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Tue, 11 Feb 2020 20:54:01 +0100 Subject: webui: force import order --- webui/codegen.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webui/codegen.yaml') diff --git a/webui/codegen.yaml b/webui/codegen.yaml index 161fd1c7..30b67e45 100644 --- a/webui/codegen.yaml +++ b/webui/codegen.yaml @@ -26,4 +26,4 @@ generates: hooks: afterOneFileWrite: - - prettier --write + - eslint --fix -- cgit From b70b4ba4b17d02d9744bd72494549f5cf7d980f8 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Tue, 11 Feb 2020 22:11:08 +0100 Subject: webui: lint graphql files --- webui/codegen.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'webui/codegen.yaml') diff --git a/webui/codegen.yaml b/webui/codegen.yaml index 30b67e45..1580632e 100644 --- a/webui/codegen.yaml +++ b/webui/codegen.yaml @@ -10,9 +10,12 @@ generates: ./src/gqlTypes.ts: plugins: - typescript + ./src/schema.json: + plugins: + - introspection ./src/: plugins: - - add: '/* eslint-disable @typescript-eslint/no-unused-vars */' + - add: '/* eslint-disable @typescript-eslint/no-unused-vars, import/order */' - typescript-operations - typescript-react-apollo preset: near-operation-file @@ -25,5 +28,5 @@ generates: withHooks: true hooks: - afterOneFileWrite: - - eslint --fix + afterAllFileWrite: + - prettier --write -- cgit From d0a6da286a28e79ae3bb75af41219c4cc4df20b0 Mon Sep 17 00:00:00 2001 From: ludovicm67 Date: Wed, 12 Feb 2020 23:09:45 +0100 Subject: webui: finish TypeScript conversion --- webui/codegen.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'webui/codegen.yaml') diff --git a/webui/codegen.yaml b/webui/codegen.yaml index 1580632e..3cdb0517 100644 --- a/webui/codegen.yaml +++ b/webui/codegen.yaml @@ -2,22 +2,22 @@ schema: '../graphql/schema/*.graphql' overwrite: true documents: src/**/*.graphql generates: - ./src/fragmentTypes.js: + ./src/fragmentTypes.ts: plugins: - - fragment-matcher + - fragment-matcher config: module: es2015 ./src/gqlTypes.ts: plugins: - - typescript + - typescript ./src/schema.json: plugins: - - introspection + - introspection ./src/: plugins: - - add: '/* eslint-disable @typescript-eslint/no-unused-vars, import/order */' - - typescript-operations - - typescript-react-apollo + - add: '/* eslint-disable @typescript-eslint/no-unused-vars, import/order */' + - typescript-operations + - typescript-react-apollo preset: near-operation-file presetConfig: extension: .generated.tsx @@ -29,4 +29,4 @@ generates: hooks: afterAllFileWrite: - - prettier --write + - prettier --write -- cgit