GraphQL: How nested to make schema?

GraphQL's purpose is to avoid a couple of queries, so I'm sure that making the nested structure is the right way. With security in mind, add some GraphQL depth limit libraries.

GraphQL style guides suggest you have all complex structures in separate Object Types ( as you have, Comment, Team, Board... ). Then making a complex query/mutation is up to you.

I'd like you to expand this sentence

Which if I add a comment, publish the entire board update is incredibly inefficient

I'm not sure about this as you have your id of the Card. So adding new comment will trigger mutation which will create new Comment record and update Card with the new comment.

So your structure of data on the backend will define the way you fetch it but not so much the way you mutate it.

Take a look at the GitHub GraphQL API for example:

  • each of the mutations is a small function for updating/creating piece of the complex tree even if they have nested structure of types on the backend.

In addition for general knowledge of what are approaches for designing the mutations, I'd suggest this article.