Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/node-libraries/pothos-schema-exporter

Plugin to output 'schema.graphql' from pothos to file
https://github.com/node-libraries/pothos-schema-exporter

Last synced: 1 day ago
JSON representation

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

Awesome Lists containing this project

README

        

# pothos-schema-exporter

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

## usage

Set the output path to `output`

```ts
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

```ts
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"),
},
});
```