Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizencc authored Sep 17, 2024
1 parent 36b0236 commit bba2dcc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/aws-cdk/lib/api/hotswap/appsync-mapping-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export async function isHotswappableAppSyncChange(
delete sdkRequestObject.runtime;
}

const functions = await getAppSyncFunctions(sdk, sdkRequestObject.apiId, undefined);
const functions = await getAppSyncFunctions(sdk, sdkRequestObject.apiId);
const { functionId } = functions?.find(fn => fn.name === physicalName) ?? {};
// Updating multiple functions at the same time or along with graphql schema results in `ConcurrentModificationException`
await simpleRetry(
Expand Down Expand Up @@ -159,7 +159,7 @@ async function sleep(ms: number) {
/**
* Get all functions for a given AppSync API by iterating through the paginated list of functions
*/
async function getAppSyncFunctions(sdk: ISDK, apiId: string, nextToken: string | undefined): Promise<FunctionConfiguration[]> {
async function getAppSyncFunctions(sdk: ISDK, apiId: string, nextToken?: string): Promise<FunctionConfiguration[]> {
const ret = new Array<FunctionConfiguration>();
return sdk.appsync().listFunctions({ apiId, nextToken }).promise()
.then(async (listFunctionsResponse: ListFunctionsResponse) => {
Expand Down

0 comments on commit bba2dcc

Please sign in to comment.