Plugin to output 'schema.graphql' from pothos to file
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"),
},
});