How to use the graphql-transformer-core.readProjectConfiguration function in graphql-transformer-core

To help you get started, we’ve selected a few graphql-transformer-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-amplify / amplify-cli / packages / amplify-category-api / provider-utils / awscloudformation / service-walkthroughs / appSync-walkthrough.js View on Github external
return;
  }

  const parametersFilePath = path.join(resourceDir, parametersFileName);
  let parameters = {};

  try {
    parameters = context.amplify.readJsonFile(parametersFilePath);
  } catch (e) {
    context.print.error('Parameters file not found');
    context.print.info(e.stack);
  }

  // Get models

  const project = await TransformPackage.readProjectConfiguration(resourceDir);

  // Check for common errors
  const directiveMap = collectDirectivesByTypeNames(project.schema);
  let modelTypes = [];

  if (directiveMap.types) {
    Object.keys(directiveMap.types).forEach(type => {
      if (directiveMap.types[type].includes('model')) {
        modelTypes.push(type);
      }
    });
  }

  /* eslint-disable */
  ({ authConfig, defaultAuthType } = await askDefaultAuthQuestion(context, parameters));
  ({ authConfig, resolverConfig } = await askAdditionalQuestions(context, parameters, authConfig, defaultAuthType, modelTypes));
github aws-amplify / amplify-cli / packages / amplify-provider-awscloudformation / lib / transform-graphql-schema.js View on Github external
let deploymentRootKey = await getPreviousDeploymentRootKey(previouslyDeployedBackendDir);
  if (!deploymentRootKey) {
    const deploymentSubKey = await hashDirectory(resourceDir);
    deploymentRootKey = `${ROOT_APPSYNC_S3_KEY}/${deploymentSubKey}`;
  }
  const projectBucket = options.dryRun ? 'fake-bucket' : getProjectBucket(context);
  const buildParameters = {
    ...parameters,
    S3DeploymentBucket: projectBucket,
    S3DeploymentRootKey: deploymentRootKey,
  };

  fs.ensureDirSync(buildDir);
  // Transformer compiler code
  // const schemaText = await TransformPackage.readProjectSchema(resourceDir);
  const project = await TransformPackage.readProjectConfiguration(resourceDir);

  // Check for common errors
  const directiveMap = collectDirectivesByTypeNames(project.schema);
  warnOnAuth(context, directiveMap.types);

  await transformerVersionCheck(context, resourceDir, previouslyDeployedBackendDir, resourcesToBeUpdated, directiveMap.directives);

  const transformerListFactory = getTransformerFactory(context, resourceDir, authConfig);

  let searchableTransformerFlag = false;

  if (directiveMap.directives.includes('searchable')) {
    searchableTransformerFlag = true;
  }

  const buildConfig = {