Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/node-libraries/pothos-query-generator
Plugin to output 'query.graphql' from pothos to file
https://github.com/node-libraries/pothos-query-generator
Last synced: about 2 months ago
JSON representation
Plugin to output 'query.graphql' from pothos to file
- Host: GitHub
- URL: https://github.com/node-libraries/pothos-query-generator
- Owner: node-libraries
- License: mit
- Created: 2023-10-10T01:46:59.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-10T01:53:38.000Z (over 1 year ago)
- Last Synced: 2024-11-17T12:48:46.020Z (about 2 months ago)
- Language: TypeScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pothos-query-generator
A plugin for Pothos that generates GraphQL queries using graphql-auto-query
## usage
Set the output path to `output`.
The depth of the query is set by `depth`.```ts
import PothosQueryGeneratorPlugin from "pothos-query-generator";export const builder = new SchemaBuilder({
plugins: [PothosQueryGeneratorPlugin],
pothosSchemaExporter: {
output: "query.graphql",
depth: 2,
},
});
```If `undefined`,`null`,`false` is set, no file will be output
```ts
import PothosQueryGeneratorPlugin from "pothos-query-generator";export const builder = new SchemaBuilder({
plugins: [PothosQueryGeneratorPlugin],
pothosQueryGenerator: {
output:
process.env.NODE_ENV === "development" &&
path.join(process.cwd(), "graphql", "query.graphql"),
},
});
```