How to use the graphql-relational-schema-transformer.AuroraServerlessMySQLDatabaseReader function in graphql-relational-schema-transformer

To help you get started, we’ve selected a few graphql-relational-schema-transformer 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 / commands / api / add-graphql-datasource.js View on Github external
teamProviderInfo[currEnv][categories][category][resourceName][rdsDatabaseName] = answers.databaseName;

        fs.writeFileSync(teamProviderInfoFilePath, JSON.stringify(teamProviderInfo, null, 4));

        const backendConfigFilePath = amplify.pathManager.getBackendConfigFilePath();
        const backendConfig = context.amplify.readJsonFile(backendConfigFilePath);

        backendConfig[category][resourceName][rdsInit] = true;

        fs.writeFileSync(backendConfigFilePath, JSON.stringify(backendConfig, null, 4));

        /**
         * Load the MySqlRelationalDBReader
         */
        // eslint-disable-next-line max-len
        const dbReader = new AuroraServerlessMySQLDatabaseReader(
          answers.region,
          answers.secretStoreArn,
          answers.dbClusterArn,
          answers.databaseName,
          AWS
        );

        /**
         * Instantiate a new Relational Schema Transformer and perform
         * the db instrospection to get the GraphQL Schema and Template Context
         */
        const relationalSchemaTransformer = new RelationalDBSchemaTransformer(dbReader, answers.databaseName);
        return relationalSchemaTransformer.introspectDatabaseSchema();
      })
      .then(graphqlSchemaContext => {

graphql-relational-schema-transformer

An AppSync model transform that takes a relational database and turns that into a GraphQL API.

Apache-2.0
Latest version published 22 days ago

Package Health Score

93 / 100
Full package analysis