0.0.2 • Published 7 months ago

pothos-query-generator v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

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.

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

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

7 months ago

0.0.1

7 months ago