Skip to content

Commit

Permalink
fix(client-preset): allow non-typescript plugins (#8523)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlypoly authored Oct 25, 2022
1 parent cb44490 commit 3a3202f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fair-mugs-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/client-preset': patch
---

allow non-typescript plugins
6 changes: 4 additions & 2 deletions packages/presets/client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ export const preset: Types.OutputPreset<ClientPresetConfig> = {
throw new Error('[client-preset] target output should be a directory, ex: "src/gql/"');
}

if (options.plugins.length > 0) {
throw new Error('[client-preset] providing `plugins` with `preset: "client" leads to duplicated generated types');
if (options.plugins.length > 0 && Object.keys(options.plugins).some(p => p.startsWith('typescript'))) {
throw new Error(
'[client-preset] providing typescript-based `plugins` with `preset: "client" leads to duplicated generated types'
);
}

const reexports: Array<string> = [];
Expand Down

0 comments on commit 3a3202f

Please sign in to comment.