Subgraph Documentation — How to document your Subgraph with The Graph

paulieb.eth
Graphtronauts Community
4 min readSep 21, 2022
Image brought to you by Graph Advocate Larik

Subgraph Documentation

What is it?

The subgraph documentation is the final piece to put the finishing touch on your work. You want to fully document your project in all aspects and the subgraph portion is no exception.

Why create it?

Quality documentation is a benchmark of any healthy crypto project. For open-source projects you want to maintain a well documented project. Well-curated documentation increases your project’s approachability, provides guidance, and fosters the type collaboration that propels development.

Hosting your documentation on the web can present time-consuming challenges that make publishing and maintaining it an unrewarding experience — one that it’s often easy to avoid. This is where I can help. I are here to provide you help by reaching out.

Documentation helps developers integrate aspects of a protocol within their applications. For example, let’s say you want to create a token and you want people to be able to buy this token. You may decide to use a Uniswap pool to enable this. You would then need to query this pool in order to show users the token’s price. The documentation explains the necessary steps to be able to create this query and gives useful data on other information you can obtain. Since people use other protocols inside their app (think lego pieces), this facilitates the developers speed to integrate a protocol and provide a better user experience.

How to get help:

Examples:

An example of good subgraph documentation completed is LooksRare — https://docs.looksrare.org/developers/subgraph-documentation/looksrare-subgraph-entities

We add the following three pages when building documentation for your subgraph:

1. Subgraph Information and links:

2. Cleanly categorized list of your Schema.GraphQL:

3. Query Examples:

The following projects have documentation and the list is growing. Feel free to click on “Subgraph Docs” below which is a link to each project to see as example. Some may have changed after this publication.

Image brought to you by Graph Advocate Larik

It is also good to know that if you add descriptions to you Schema.GraphQL then the descriptions show up when you use sites like GraphiQL GUI and also in the Playground in the Graph Explorer. When you hover over items within your entity it displays the descriptions which can help develop queries as shown below:

Schema- description are in quotes
Audius — when you hover over totalSupply — the description “Total supply of $AUDIO” shows
Closer look when you hover over blockNumber — description is displayed

Please share this articles to projects that maybe interested in subgraph documentation. Leave a message on this blog or contact via Linktree

--

--

paulieb.eth
Graphtronauts Community

Graph Advocates DAO member. Graphtronauts Member. Technical Writer for Pinax