{"_id":"pothos-query-generator","_rev":"3-6350b51f844f7f5c68a029239cabf8cd","name":"pothos-query-generator","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.1":{"name":"pothos-query-generator","version":"0.0.1","keywords":["graphql","pothos","schema.graphql"],"author":{"name":"SoraKumo"},"license":"MIT","_id":"pothos-query-generator@0.0.1","maintainers":[{"name":"sora_kumo","email":"info@croud.jp"}],"homepage":"https://github.com/node-libraries/pothos-query-generator#readme","bugs":{"url":"https://github.com/node-libraries/pothos-query-generator/issues"},"dist":{"shasum":"381a312bb44b5315b729f4ec8b946b938e1e9b8c","tarball":"https://registry.npmjs.org/pothos-query-generator/-/pothos-query-generator-0.0.1.tgz","fileCount":12,"integrity":"sha512-wV2pY/xSlrTmazqG7WsH2+5yJxwrB7w9m9kwhWl3zN4UhcxNH0hcsyuG59tkSGdOqVpEBLa+2zoWycOr9ovZiQ==","signatures":[{"sig":"MEQCIDueC/T1zvEdQCwLM1s+eAtnU+Pznm8PNe9XD8eH0CLdAiBSknnFt+rmZxHGEvBBjSObCHg/eVVEGMFJK9u5oS98NA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8712},"main":"./dist/cjs/index.js","types":"./dist/cjs/index.d.ts","exports":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"gitHead":"9c28944f006ac08f75d75030ad4ff9b83065feb0","scripts":{"test":"jest","build":"tsc && tsc --project ./tsconfig.esm.json && cpy esm dist"},"_npmUser":{"name":"sora_kumo","email":"info@croud.jp"},"repository":{"url":"git+https://github.com/node-libraries/pothos-query-generator.git","type":"git"},"_npmVersion":"9.7.2","description":"Plugin to output 'query.graphql' from pothos to file","directories":{},"_nodeVersion":"18.17.0","dependencies":{"graphql-auto-query":"^0.0.6"},"_hasShrinkwrap":false,"devDependencies":{"cpy-cli":"^5.0.0","graphql":"^16.8.1","typescript":"^5.2.2","@types/node":"^20.8.4","@pothos/core":"^3.38.0"},"_npmOperationalInternal":{"tmp":"tmp/pothos-query-generator_0.0.1_1696902847211_0.980871276462143","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"pothos-query-generator","version":"0.0.2","keywords":["graphql","pothos","schema.graphql"],"author":{"name":"SoraKumo"},"license":"MIT","_id":"pothos-query-generator@0.0.2","maintainers":[{"name":"sora_kumo","email":"info@croud.jp"}],"homepage":"https://github.com/node-libraries/pothos-query-generator#readme","bugs":{"url":"https://github.com/node-libraries/pothos-query-generator/issues"},"dist":{"shasum":"84c4658ad8fb62c9e711f1d9f5c12b15b707c693","tarball":"https://registry.npmjs.org/pothos-query-generator/-/pothos-query-generator-0.0.2.tgz","fileCount":12,"integrity":"sha512-yPsrCBici8JdoyzgJYhwBN5/KkPn98qgAsrJ0ZDv+ufTDmOYgdXzFHTI8iDBHsLzvw8FL5Dtth7y2dQuTPLkoQ==","signatures":[{"sig":"MEQCID0JtHMqdFq1atrw/YBfstJiP7/Hnhg1EhDPs8ilFmMfAiB6BnEAz7GcSqNrZ+i0uyGMDxro57QsmFp2RH1b8YJMdQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":8712},"main":"./dist/cjs/index.js","types":"./dist/cjs/index.d.ts","exports":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"gitHead":"9c28944f006ac08f75d75030ad4ff9b83065feb0","scripts":{"test":"jest","build":"tsc && tsc --project ./tsconfig.esm.json && cpy esm dist"},"_npmUser":{"name":"sora_kumo","email":"info@croud.jp"},"repository":{"url":"git+https://github.com/node-libraries/pothos-query-generator.git","type":"git"},"_npmVersion":"9.7.2","description":"Plugin to output 'query.graphql' from pothos to file","directories":{},"_nodeVersion":"18.17.0","dependencies":{"graphql-auto-query":"^0.0.7"},"_hasShrinkwrap":false,"devDependencies":{"cpy-cli":"^5.0.0","graphql":"^16.8.1","typescript":"^5.2.2","@types/node":"^20.8.4","@pothos/core":"^3.38.0"},"_npmOperationalInternal":{"tmp":"tmp/pothos-query-generator_0.0.2_1696906374404_0.4529671510451947","host":"s3://npm-registry-packages"}},"1.0.0":{"name":"pothos-query-generator","version":"1.0.0","main":"./dist/cjs/index.js","types":"./dist/cjs/index.d.ts","exports":{"require":"./dist/cjs/index.js","import":"./dist/esm/index.js"},"description":"Plugin to output 'query.graphql' from pothos to file","scripts":{"build":"tsc && tsc --project ./tsconfig.esm.json && cpy esm dist","test":"jest"},"license":"MIT","keywords":["graphql","pothos","schema.graphql"],"author":{"name":"SoraKumo"},"devDependencies":{"@pothos/core":"^4.12.0","@types/node":"^25.0.10","cpy-cli":"^6.0.0","graphql":"^16.12.0","typescript":"^5.9.3"},"dependencies":{"graphql-auto-query":"^1.1.1"},"repository":{"type":"git","url":"git+https://github.com/node-libraries/pothos-query-generator.git"},"gitHead":"9c28944f006ac08f75d75030ad4ff9b83065feb0","_id":"pothos-query-generator@1.0.0","bugs":{"url":"https://github.com/node-libraries/pothos-query-generator/issues"},"homepage":"https://github.com/node-libraries/pothos-query-generator#readme","_nodeVersion":"24.11.1","_npmVersion":"11.7.0","dist":{"integrity":"sha512-ivYKaVQw/bkNgYh5AutWKaVPsFjJpPaQzGudr9TEKYtvCAaiAsZyWy70C2e4+Jd06/edmQZycKCS5o7NXNYd6Q==","shasum":"eb13b69b1a0113bdbaf4bce7120e79bbb438236a","tarball":"https://registry.npmjs.org/pothos-query-generator/-/pothos-query-generator-1.0.0.tgz","fileCount":12,"unpackedSize":11763,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCoNWsc/ZxjLnguzwDLaYfVsBAgrmpXwofjSf9hAimr+wIhAMUiYWby61BFqoAkBvz3YkKRzt04oE2eXcRUs0PQPR92"}]},"_npmUser":{"name":"sora_kumo","email":"info@croud.jp"},"directories":{},"maintainers":[{"name":"sora_kumo","email":"info@croud.jp"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pothos-query-generator_1.0.0_1769489882715_0.3963152970626147"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-10T01:54:07.210Z","modified":"2026-01-27T04:58:02.991Z","0.0.1":"2023-10-10T01:54:07.353Z","0.0.2":"2023-10-10T02:52:54.574Z","1.0.0":"2026-01-27T04:58:02.869Z"},"bugs":{"url":"https://github.com/node-libraries/pothos-query-generator/issues"},"author":{"name":"SoraKumo"},"license":"MIT","homepage":"https://github.com/node-libraries/pothos-query-generator#readme","keywords":["graphql","pothos","schema.graphql"],"repository":{"type":"git","url":"git+https://github.com/node-libraries/pothos-query-generator.git"},"description":"Plugin to output 'query.graphql' from pothos to file","maintainers":[{"name":"sora_kumo","email":"info@croud.jp"}],"readme":"# pothos-query-generator\n\n[![](https://img.shields.io/npm/l/pothos-query-generator)](https://www.npmjs.com/package/pothos-query-generator)\n[![](https://img.shields.io/npm/v/pothos-query-generator)](https://www.npmjs.com/package/pothos-query-generator)\n[![](https://img.shields.io/npm/dw/pothos-query-generator)](https://www.npmjs.com/package/pothos-query-generator)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/node-libraries/pothos-query-generator)\n\nA plugin for [Pothos](https://pothos-graphql.dev/) that automatically generates example GraphQL queries using [graphql-auto-query](https://github.com/SoraKumo001/graphql-auto-query).\n\nThis plugin hooks into the Pothos schema build process and outputs a file containing generated queries based on your schema definition.\n\n## Usage\n\n### Basic Setup\n\nAdd the plugin to your `SchemaBuilder` and configure the `pothosQueryGenerator` options.\n\n```ts\nimport SchemaBuilder from \"@pothos/core\";\nimport PothosQueryGeneratorPlugin from \"pothos-query-generator\";\n\nconst builder = new SchemaBuilder({\n  plugins: [PothosQueryGeneratorPlugin],\n  pothosQueryGenerator: {\n    // Path to the output file\n    output: \"query.graphql\",\n    // Optional: Depth of the generated queries (default depends on graphql-auto-query)\n    depth: 2,\n  },\n});\n\n// ... define your schema ...\n\nbuilder.toSchema();\n```\n\n### Conditional Output\n\nYou can conditionally disable the output by setting `output` to `false`, `null`, or `undefined`. This is useful for generating files only in development environments.\n\n```ts\nimport path from \"path\";\nimport SchemaBuilder from \"@pothos/core\";\nimport PothosQueryGeneratorPlugin from \"pothos-query-generator\";\n\nconst builder = new SchemaBuilder({\n  plugins: [PothosQueryGeneratorPlugin],\n  pothosQueryGenerator: {\n    output:\n      process.env.NODE_ENV === \"development\"\n        ? path.join(process.cwd(), \"graphql\", \"query.graphql\")\n        : false,\n  },\n});\n```\n\n## Options\n\n| Option              | Type                      | Description                                                                                   |\n| ------------------- | ------------------------- | --------------------------------------------------------------------------------------------- |\n| `output`            | `string \\| null \\| false` | The file path where the generated queries will be saved. If falsy, no file is written.        |\n| `depth`             | `number`                  | (Optional) The recursion depth for generating nested fields in the query.                     |\n| `queryDepth`        | `number`                  | (Optional) The recursion depth for generating nested fields in the query. (overrides `depth`) |\n| `mutationDepth`     | `number`                  | (Optional) The recursion depth for generating nested fields in the mutation.                  |\n| `subscriptionDepth` | `number`                  | (Optional) The recursion depth for generating nested fields in the subscription.              |\n\n## License\n\nMIT\n","readmeFilename":"README.md"}