Skip to content

Commit

Permalink
fix(graphql): handle sandbox pull with no environment info (#9776)
Browse files Browse the repository at this point in the history
  • Loading branch information
sundersc committed Feb 16, 2022
1 parent 4cf6274 commit 0c6508b
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -44,8 +44,16 @@ export const getIdentityPoolId = async (ctx: $TSContext): Promise<string | undef
};

export const getAdminRoles = async (ctx: $TSContext, apiResourceName: string | undefined): Promise<Array<string>> => {
const currentEnv = ctx.amplify.getEnvInfo().envName;
let currentEnv;
const adminRoles = new Array<string>();

try {
currentEnv = ctx.amplify.getEnvInfo().envName;
} catch (err) {
// When there is no environment info, return [] - This is required for sandbox pull
return [];
}

//admin ui roles
try {
const amplifyMeta = stateManager.getMeta();
Expand Down

0 comments on commit 0c6508b

Please sign in to comment.