{"id":21916517,"url":"https://github.com/codesignal/graphqldoc","last_synced_at":"2025-08-08T05:05:32.203Z","repository":{"id":34368372,"uuid":"177645401","full_name":"CodeSignal/graphqldoc","owner":"CodeSignal","description":"Generate GraphQL docs from schema.","archived":false,"fork":false,"pushed_at":"2023-01-03T18:31:47.000Z","size":2847,"stargazers_count":7,"open_issues_count":23,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-28T10:48:22.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodeSignal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-25T18:49:36.000Z","updated_at":"2023-07-16T13:39:54.000Z","dependencies_parsed_at":"2023-01-15T06:37:50.664Z","dependency_job_id":null,"html_url":"https://github.com/CodeSignal/graphqldoc","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/CodeSignal/graphqldoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeSignal%2Fgraphqldoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeSignal%2Fgraphqldoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeSignal%2Fgraphqldoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeSignal%2Fgraphqldoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeSignal","download_url":"https://codeload.github.com/CodeSignal/graphqldoc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeSignal%2Fgraphqldoc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269366853,"owners_count":24405250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-08T02:00:09.200Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T19:18:18.561Z","updated_at":"2025-08-08T05:05:32.180Z","avatar_url":"https://github.com/CodeSignal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generate GraphQL docs from schema.\n\n* [install](#install)\n* [use](#use)\n* [plugin](#plugin)\n\nForked from the excellent but unfortunately unmaintained [graphdoc package](https://github.com/2fd/graphdoc).\n\n## Install\n\nTo install globally:\n```bash\n    npm install -g graphqldoc\n```\n\n## Use\n\n### Generate documentation from live endpoint\n\n```bash\n    \u003e graphqldoc -e http://localhost:8080/graphql -o ./doc/schema\n```\n\n### Generate documentation from IDL file\n\n```bash\n    \u003e graphqldoc -s ./schema.graphql -o ./doc/schema\n```\n\n### Generate documentation from for the [\"modularized schema\"](http://dev.apollodata.com/tools/graphql-tools/generate-schema.html#modularizing) of graphql-tools\n\n```bash\n    \u003e graphqldoc -s ./schema.js -o ./doc/schema\n```\n\n\u003e `./schema.graphql` must be able to be interpreted with [graphql-js/utilities#buildSchema](http://graphql.org/graphql-js/utilities/#buildschema)\n\n\n### Generate documentation from json file\n\n```bash\n    \u003e graphqldoc -s ./schema.json -o ./doc/schema\n```\n\n\u003e `./schema.json` contains the result of GraphQL introspection query.\n\n### Puts the options in your `package.json`\n\n```javascript\n     // package.json\n\n    {\n        \"name\": \"project\",\n        // [...]\n        \"graphqldoc\": {\n            \"endpoint\": \"http://localhost:8080/graphql\",\n            \"output\": \"./doc/schema\",\n        }\n    }\n```\n\nAnd execute\n\n```bash\n    \u003e graphqldoc\n```\n\n### Help\n\n```bash\n\n    \u003e graphqldoc -h\n    \n    \u001b\u001bStatic page generator for documenting GraphQL Schema v2.4.0\n\n    \u001bUsage: node bin/graphqldoc.js [OPTIONS] \n\n    \u001b\n    \u001b\u001b[OPTIONS]:\n    \u001b\u001b-c, --config                   \u001bConfiguration file [./package.json].\n    \u001b\u001b-e, --endpoint                 \u001bGraphql http endpoint [\"https://domain.com/graphql\"].\n    \u001b\u001b-x, --header                   \u001bHTTP header for request (use with --endpoint). [\"Authorization: Token cb8795e7\"].\n    \u001b\u001b-q, --query                    \u001bHTTP querystring for request (use with --endpoint) [\"token=cb8795e7\"].\n    \u001b\u001b-s, --schema, --schema-file    \u001bGraphql Schema file [\"./schema.json\"].\n    \u001b\u001b-p, --plugin                   \u001bUse plugins [default=graphqldoc/plugins/default].\n    \u001b\u001b-t, --template                 \u001bUse template [default=graphqldoc/template/slds].\n    \u001b\u001b-o, --output                   \u001bOutput directory.\n    \u001b\u001b-d, --data                     \u001bInject custom data.\n    \u001b\u001b-b, --base-url                 \u001bBase url for templates.\n    \u001b\u001b-f, --force                    \u001bDelete outputDirectory if exists.\n    \u001b\u001b-v, --verbose                  \u001bOutput more information.\n    \u001b\u001b-V, --version                  \u001bShow graphqldoc version.\n    \u001b\u001b-h, --help                     \u001bPrint this help\n\u001b\n\n```\n\n## Plugin\n\nIn graphqldoc a plugin is simply an object that controls the content that is displayed\non every page of your document.\n\nThis object should only implement the [`PluginInterface`](https://github.com/CodeSignal/graphqldoc/blob/master/lib/interface.d.ts#L12-L117).\n\n### Make a Plugin\n\nTo create your own plugin you should only create it as a `plain object`\nor a `constructor` and export it as `default`\n\nIf you export your plugin as a constructor, when going to be initialized,\nwill receive three parameters\n\n* `schema`: The full the result of GraphQL instrospection query.\n* `projectPackage`: The content of `package.json` of current project (or the content of file defined with `--config` flag).\n* `graphqldocPackage`: The content of `package.json` of graphqldoc.\n\n\u003e For performance reasons all plugins receive the reference to the same object\n\u003e and therefore should not modify them directly as it could affect the behavior\n\u003e of other plugins (unless of course that is your intention)\n\n#### Examples\n\n```typescript\n\n    // es2015 export constructor\n    export default class MyPlugin {\n        constructor(schema, projectPackage, graphqldocPackage){}\n        getAssets() { /* ... */ }\n        /* ... */\n    }\n\n```\n\n```typescript\n    // es2015 export plain object\n    export default cost myPlugin = {\n        getAssets() { /* ... */ },\n        /* ... */\n    }\n```\n\n```javascript\n\n    // export constructor\n    function MyPlugin(schema, projectPackage, graphqldocPackage) { /* ... */ }\n\n    MyPlugin.prototype.getAssets =  function() { /* ... */ };\n    /* ... */\n\n    exports.default = MyPlugin;\n```\n\n```javascript\n\n    // export plain object\n\n    exports.default = {\n        getAssets: function() { /* ... */ },\n        /* ... */\n    }\n\n```\n\n### Use plugin\n\nYou can use the plugins in 2 ways.\n\n\n#### Use plugins with command line\n\n```bash\n    \u003e graphqldoc  -p graphqldoc/plugins/default \\\n                -p some-dependencie/plugin \\\n                -p ./lib/plugin/my-own-plugin \\\n                -s ./schema.json -o ./doc/schema\n```\n\n#### Use plugins with `package.json`\n\n```javascript\n     // package.json\n\n    {\n        \"name\": \"project\",\n        // [...]\n        \"graphqldoc\": {\n            \"endpoint\": \"http://localhost:8080/graphql\",\n            \"output\": \"./doc/schema\",\n            \"plugins\": [\n                \"graphqldoc/plugins/default\",\n                \"some-dependencie/plugin\",\n                \"./lib/plugin/my-own-plugin\"\n            ]\n        }\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesignal%2Fgraphqldoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodesignal%2Fgraphqldoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodesignal%2Fgraphqldoc/lists"}