node-libraries / pothos-schema-exporter

Plugin to output 'schema.graphql' from pothos to file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pothos-schema-exporter

Plugin to output 'schema.graphql' from pothos to file

usage

Set the output path to output

import PothosSchemaExporter from "pothos-schema-exporter";

export const builder = new SchemaBuilder({
  plugins: [PothosSchemaExporter],
  pothosSchemaExporter: {
    output: "schema.graphql",
  },
});

If undefined,null,false is set, no file will be output

import PothosSchemaExporter from "pothos-schema-exporter";

export const builder = new SchemaBuilder({
  plugins: [PothosSchemaExporter],
  pothosSchemaExporter: {
    output:
      process.env.NODE_ENV === "development" &&
      path.join(process.cwd(), "graphql", "schema.graphql"),
  },
});

About

Plugin to output 'schema.graphql' from pothos to file

License:MIT License


Languages

Language:TypeScript 100.0%