Skip to content

Commit

Permalink
fix: add missing awaits
Browse files Browse the repository at this point in the history
  • Loading branch information
alharris-at committed Sep 19, 2023
1 parent ff4e221 commit 4c63760
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function generateStatementsAndTypes(context, forceDownloadSchema, maxDepth
if (!withoutInit) {
apis = getAppSyncAPIDetails(context);
} else {
const api = getAppSyncAPIInfoFromProject(context, project);
const api = await getAppSyncAPIInfoFromProject(context, project);
if (api) {
apis = [api];
}
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-codegen/src/commands/statements.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function generateStatements(context, forceDownloadSchema, maxDepth, withou
if (!withoutInit) {
apis = getAppSyncAPIDetails(context);
} else {
const api = getAppSyncAPIInfoFromProject(context, projects[0]);
const api = await getAppSyncAPIInfoFromProject(context, projects[0]);
if (api) {
apis = [api];
}
Expand Down
2 changes: 1 addition & 1 deletion packages/amplify-codegen/src/commands/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function generateTypes(context, forceDownloadSchema, withoutInit = false,
if (!withoutInit) {
apis = getAppSyncAPIDetails(context);
} else {
const api = getAppSyncAPIInfoFromProject(context, projects[0]);
const api = await getAppSyncAPIInfoFromProject(context, projects[0]);
if (api) {
apis = [api];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const getAppSyncAPIInfo = require('./getAppSyncAPIInfo');
/* Get AppSync api info if api id and region are avialable.
* Otherwise return undefined.
*/
function getAppSyncAPIInfoFromProject(context, project) {
async function getAppSyncAPIInfoFromProject(context, project) {
if (project.amplifyExtension.apiId && project.amplifyExtension.region) {
const {
amplifyExtension: { apiId, region },
Expand Down

0 comments on commit 4c63760

Please sign in to comment.