pothos-query-generator
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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

/pothos-query-generator/

    Package Sidebar

    Install

    npm i pothos-query-generator

    Weekly Downloads

    134

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    8.71 kB

    Total Files

    12

    Last publish

    Collaborators

    • sora_kumo