How to use the @gapi/core.mergeSchemas function in @gapi/core

To help you get started, we’ve selected a few @gapi/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 rxdi / graphqj / lib / app / app.module.js View on Github external
config.$schema = config.$schema || args_extractors_1.nextOrDefault('--schema', false);
                        if (config.$schema) {
                            externalSchema = fs_1.readFileSync(config.$schema, {
                                encoding: 'utf-8'
                            });
                            externalSchema = core_1.buildSchema(externalSchema);
                        }
                    }
                    catch (e) { }
                    const schemas = [externalSchema, schema].filter(i => !!i);
                    let mergedSchemas;
                    if (schemas.length === 1) {
                        mergedSchemas = schema;
                    }
                    else {
                        mergedSchemas = core_1.mergeSchemas({
                            schemas
                        });
                    }
                    if (args_extractors_1.includes('--verbose')) {
                        console.log(`
Schema:
${core_1.printSchema(mergedSchemas)}
                  `);
                    }
                    if (process.argv.toString().includes('--generate')) {
                        util_1.promisify(fs_1.writeFile)('./schema.graphql', core_1.printSchema(mergedSchemas), {
                            encoding: 'utf-8'
                        }).then(() => {
                            console.log('Schema created!');
                            process.exit(0);
                        });
github rxdi / graphqj / src / app / app.module.ts View on Github external
})
          );
          config.$schema = config.$schema || nextOrDefault('--schema', false);
          if (config.$schema) {
            externalSchema = readFileSync(config.$schema, {
              encoding: 'utf-8'
            });
            externalSchema = buildSchema(externalSchema);
          }
        } catch (e) {}
        const schemas = [externalSchema, schema].filter(i => !!i);
        let mergedSchemas: GraphQLSchema;
        if (schemas.length === 1) {
          mergedSchemas = schema;
        } else {
          mergedSchemas = mergeSchemas({
            schemas
          });
        }

        if (includes('--verbose')) {
          console.log(`
Schema:
${printSchema(mergedSchemas)}
                  `);
        }

        if (process.argv.toString().includes('--generate')) {
          promisify(writeFile)('./schema.graphql', printSchema(mergedSchemas), {
            encoding: 'utf-8'
          }).then(() => {
            console.log('Schema created!');