Generate GraphQL Docs
Jul 17, 2019
If you want to work with the graphQL, it is much easier if you can get the schema and documentation for graphQL. I test graphQL query using insomnia. However the DOC section in insomnia doesn’t show the graphQL doc.
There are several ways to fetch the graphQL doc.
App
If you want to use an App to easily view the graphQL doc, try Altair. Altair GraphQL Client
Write the URL in the middle and press the Docs button on the right side.
Generate Site
If you don’t want to use Altair like me, you can try the following way to generate the HTML doc instead.
First install the graphdoc tool if you have not. Official Repository
1 | npm install -g @2fd/graphdoc |
After install you will be able to generate the documentation from a live endpoint:
1 | graphdoc -e http://localhost:8080/graphql -o ./doc/schema |
