From 138da96190bc7c569fedd33e262fa4c8d912aa45 Mon Sep 17 00:00:00 2001 From: Dane Pilcher Date: Fri, 22 Sep 2023 16:23:48 -0600 Subject: [PATCH] fix: correct wirteToDirectory for graphql-codegen format --- packages/model-generator/src/generate_api_code.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/model-generator/src/generate_api_code.ts b/packages/model-generator/src/generate_api_code.ts index 4ad44f68f4..6841ef8bbf 100644 --- a/packages/model-generator/src/generate_api_code.ts +++ b/packages/model-generator/src/generate_api_code.ts @@ -77,7 +77,15 @@ export const generateApiCode = async ( target: props.typeTarget, multipleSwiftFiles: props.multipleSwiftFiles, }); - return { ...documents, ...types }; + + return { + writeToDirectory: async (directoryPath: string) => { + await Promise.all([ + documents.writeToDirectory(directoryPath), + types.writeToDirectory(directoryPath), + ]); + }, + }; } return documents;