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.
Comments
0 commentsArticle is closed for comments.