A GraphQL Documentation Explorer for Emacs
Uses the GraphQL instrospection API to display documentation for queries, mutations, and types provided by graphql endpoints. Inspired by the documentation explorer provided by GraphiQL.
There are two commands provided to open up the graphql-doc explorer
- graphql-doc prompts you to select an endpoint added by graphql-doc-add-api
Use this for graphql endpoints that you use often, or need additional configuration such as authorization headers.
- graphql-doc-open-url prompts you to provide a graphql endpoint url
Use this to quickly view the documentation for endpoints that don’t need additional configuration.
This package provides the function graphql-doc-add-api to add endpoints to the alist graphql-doc-apis. These endpoints are then selectable by name by calling graphql-doc.
If the endpoint does not require autorization, you only need to provide a name, and an api configuration with a url.
(graphql-doc-add-api
"GDC (national cancer institute)"
`(:url "https://api.gdc.cancer.gov/v0/graphql"))
If the endpoint does requires an autorization header (or any other additional headers), you can provide that with the headers property in your api configuration.
(graphql-doc-add-api
"My cool graphql endpoint"
`(:url "https://awesome-endpoints.com/v0/graphql"
:headers (("authorization" . "bearer my-secret-api-token")
("Exta-Header" . "another example header"))))
Some endpoints may expect additional post body parameters, which you can provide with the data property in your api configuration.
(graphql-doc-add-api
"My cool graphql endpoint"
`(:url "https://awesome-endpoints.com/v0/graphql"
:data (("additional-data" . "example data")
("authorization" . "this endpoint expects authorization in the post body!"))))
Binding | Command |
---|---|
C-j | forward-button |
C-k | backward-button |
<backspace> | graphql-doc-go-back |
Keybindings on buttons:
Binding | Command |
---|---|
mouse-1 | follows link |
?\r | follows link |