From 75198f97ac022c5a87cf573d90606868d0deece8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20R=2E=20Montes?= Date: Thu, 3 Nov 2022 17:46:43 -0300 Subject: [PATCH] Sdk-gen duplicated fragments bugfix (#33) * update codegen config * Create duplicated-fragments.md --- .changeset/duplicated-fragments.md | 7 +++++++ packages/sdk-gen/src/generate.ts | 1 + 2 files changed, 8 insertions(+) create mode 100644 .changeset/duplicated-fragments.md diff --git a/.changeset/duplicated-fragments.md b/.changeset/duplicated-fragments.md new file mode 100644 index 0000000..0fdbec7 --- /dev/null +++ b/.changeset/duplicated-fragments.md @@ -0,0 +1,7 @@ +--- +"@bsmnt/sdk-gen": patch +--- + + * Add `dedupeFragments` to codegen config. *It cleans the generated schema to avoid recurrent references to the same fragment in one query.* + + > Issue related: https://github.com/dotansimha/graphql-code-generator/issues/3063 diff --git a/packages/sdk-gen/src/generate.ts b/packages/sdk-gen/src/generate.ts index 5a15e8c..93c24d6 100644 --- a/packages/sdk-gen/src/generate.ts +++ b/packages/sdk-gen/src/generate.ts @@ -43,6 +43,7 @@ export async function main(args: Args) { "typescript-generic-sdk", ], config: { + dedupeFragments: true, useTypeImports: true, documentMode: "string", },