Namespacing by Separation of Concerns

Have more questions? Submit a request

Most GraphQL APIs provide their capabilities as root-level fields of the Query and Mutation types, resulting in a flat structure. For example, the GitHub GraphQL API has approximately 200 of these root-level fields! Even with tools like the Apollo Explorer, navigating and understanding larger "flat" graphs can be difficult.

To improve the logical organization of our graph's capabilities, we can define namespaces for our root-level operation fields. These are object types that in turn define query and mutation fields that are all related to a particular concern.

Learn more on the dev docs.

Articles in this section

Was this article helpful?
0 out of 0 found this helpful
Share

Comments

0 comments

Article is closed for comments.