Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function prePushGraphQLCodegen(context, createResources, updateResources) {
createResources = createResources.filter(resource => resource.service === 'AppSync');
// There can only be one appsync resource
if (createResources.length > 0) {
const resource = createResources[0];
const { resourceName } = resource;
graphQLConfig = await prePushAddGraphQLCodegenHook(context, resourceName);
return;
}
if (updateResources.length > 0) {
const resource = updateResources[0];
const { resourceName } = resource;
graphQLConfig = await prePushUpdateGraphQLCodegenHook(context, resourceName);
}
}