How to use the apollo-codegen-flow.generateSource function in apollo-codegen-flow

To help you get started, we’ve selected a few apollo-codegen-flow 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 apollographql / apollo-tooling / packages / apollo / src / generate.ts View on Github external
if (outputIndividualFiles) {
      writeGeneratedFiles(generator.generatedFiles, outputPath, "\n");
      writtenFiles += Object.keys(generator.generatedFiles).length;
    } else {
      fs.writeFileSync(outputPath, generator.output.concat("\n"));
      writtenFiles += 1;
    }

    if (options.generateOperationIds) {
      writeOperationIdsMap(context);
      writtenFiles += 1;
    }
  } else if (target === "flow") {
    const context = compileToIR(schema, document, options);
    const { generatedFiles, common } = generateFlowSource(context);

    const outFiles: {
      [fileName: string]: BasicGeneratedFile;
    } = {};

    if (nextToSources) {
      generatedFiles.forEach(({ sourcePath, fileName, content }) => {
        const dir = path.join(
          path.dirname(path.posix.relative(rootPath, toPath(sourcePath))),
          outputPath
        );
        if (!fs.existsSync(dir)) {
          fs.mkdirSync(dir);
        }

        outFiles[path.join(dir, fileName)] = {

apollo-codegen-flow

Flow generator module for Apollo Codegen

MIT
Latest version published 3 years ago

Package Health Score

64 / 100
Full package analysis

Popular apollo-codegen-flow functions

Similar packages