Skip to content

Commit

Permalink
fix: messed up merge
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardfoyle committed Oct 21, 2021
1 parent 631cd8b commit 7779c5d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/amplify-e2e-core/src/utils/headless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ExecaChildProcess<String>> => {
return await executeHeadlessCommand(cwd, 'api', 'update', request, allowDestructiveUpdates);
export const updateHeadlessApi = async (
cwd: string,
request: UpdateApiRequest,
allowDestructiveUpdates?: boolean,
): Promise<ExecaChildProcess<String>> => {
return await executeHeadlessCommand(cwd, 'api', 'update', request, undefined, allowDestructiveUpdates);
};

export const removeHeadlessApi = async (cwd: string, apiName: string): Promise<ExecaChildProcess<String>> => {
Expand Down Expand Up @@ -69,13 +73,14 @@ const executeHeadlessCommand = async (
category: string,
operation: string,
request: AnyHeadlessRequest,
reject: boolean = true,
allowDestructiveUpdates: boolean = false,
): Promise<ExecaChildProcess<String>> => {
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 =
Expand Down

0 comments on commit 7779c5d

Please sign in to comment.