diff --git a/packages/amplify-e2e-core/src/utils/headless.ts b/packages/amplify-e2e-core/src/utils/headless.ts index 94f92a1eb3f..3d367ec97b8 100644 --- a/packages/amplify-e2e-core/src/utils/headless.ts +++ b/packages/amplify-e2e-core/src/utils/headless.ts @@ -16,8 +16,12 @@ export const addHeadlessApi = async (cwd: string, request: AddApiRequest): Promi return await executeHeadlessCommand(cwd, 'api', 'add', request); }; -export const updateHeadlessApi = async (cwd: string, request: UpdateApiRequest, allowDestructiveUpdates?: boolean): Promise> => { - return await executeHeadlessCommand(cwd, 'api', 'update', request, allowDestructiveUpdates); +export const updateHeadlessApi = async ( + cwd: string, + request: UpdateApiRequest, + allowDestructiveUpdates?: boolean, +): Promise> => { + return await executeHeadlessCommand(cwd, 'api', 'update', request, undefined, allowDestructiveUpdates); }; export const removeHeadlessApi = async (cwd: string, apiName: string): Promise> => { @@ -69,13 +73,14 @@ const executeHeadlessCommand = async ( category: string, operation: string, request: AnyHeadlessRequest, + reject: boolean = true, allowDestructiveUpdates: boolean = false, ): Promise> => { const args = [operation, category, '--headless']; if (allowDestructiveUpdates) { args.push('--allow-destructive-graphql-schema-updates'); } - return await execa(getCLIPath(), args, { input: JSON.stringify(request), cwd }); + return await execa(getCLIPath(), args, { input: JSON.stringify(request), cwd, reject }); }; type AnyHeadlessRequest =