How to use amplify-graphql-types-generator - 1 common examples

To help you get started, we’ve selected a few amplify-graphql-types-generator 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-codegen / src / commands / types.js View on Github external
cwd: projectPath,
          absolute: true,
        });
        const schemaPath = path.join(projectPath, cfg.schema);
        const target = cfg.amplifyExtension.codeGenTarget;

        const outputPath = path.join(projectPath, generatedFileName);
        let region;
        if (!withoutInit) {
          ({ region } = cfg.amplifyExtension);
          await ensureIntrospectionSchema(context, schemaPath, apis[0], region, forceDownloadSchema);
        }
        const codeGenSpinner = new Ora(constants.INFO_MESSAGE_CODEGEN_GENERATE_STARTED);
        codeGenSpinner.start();
        try {
          generate(queries, schemaPath, path.join(projectPath, generatedFileName), '', target, '', {
            addTypename: true,
            complexObjectSupport: 'auto',
          });
          codeGenSpinner.succeed(`${constants.INFO_MESSAGE_CODEGEN_GENERATE_SUCCESS} ${path.relative(path.resolve('.'), outputPath)}`);
        } catch (err) {
          codeGenSpinner.fail(err.message);
        }
      });
    } catch (err) {

amplify-graphql-types-generator

Generate API code or type annotations based on a GraphQL schema and statements

Apache-2.0
Latest version published 3 years ago

Package Health Score

72 / 100
Full package analysis

Popular amplify-graphql-types-generator functions