diff --git a/.changeset/early-waves-punch.md b/.changeset/early-waves-punch.md new file mode 100644 index 00000000000..2b01cd7162b --- /dev/null +++ b/.changeset/early-waves-punch.md @@ -0,0 +1,5 @@ +--- +'@graphql-codegen/typescript-enum-array': patch +--- + +chore: remove async from a plugin, as it's never was async diff --git a/packages/plugins/typescript/enum-array/src/index.ts b/packages/plugins/typescript/enum-array/src/index.ts index 7b712fecd30..8961cc519da 100644 --- a/packages/plugins/typescript/enum-array/src/index.ts +++ b/packages/plugins/typescript/enum-array/src/index.ts @@ -30,18 +30,16 @@ function buildImportStatement(enums: GraphQLEnumType[], importFrom: string): str return [`import { ${names.join(', ')} } from "${importFrom}";`]; } -export const plugin: PluginFunction = async ( +export const plugin: PluginFunction = ( schema: GraphQLSchema, _documents: Types.DocumentFile[], config: EnumArrayPluginConfig -): Promise => { - const importFrom: EnumArrayPluginConfig['importFrom'] = config.importFrom; +): Types.PluginOutput => { const enums = getEnumTypeMap(schema); const content = enums.map(buildArrayDefinition).join('\n'); - const result: Types.PluginOutput = { content }; - if (importFrom) { - result['prepend'] = buildImportStatement(enums, importFrom); + if (config.importFrom) { + result['prepend'] = buildImportStatement(enums, config.importFrom); } return result; };