Summary
Documenting GraphQL code differs significantly from documenting code in other languages. It requires us to simultaneously consider both the individuals responsible for implementing the schema and the consumers of the schema. This dual focus ensures that our documentation effectively supports both parties, providing them with the necessary guidance and understanding to work with the GraphQL code efficiently.
In this chapter, we learned different documentation methods. We started by documenting types and interface fields, before moving on to input fields with a particular focus on highlighting the significance of documenting validation details.
Then, we ended up documenting queries and mutations, writing examples inside their documentation using the Markdown syntax to include GraphQL Query Language examples within the schema. We also documented piped queries and mutations with examples of their usage.
Now, we often find ourselves copying code between a type and its input...