Let's say we have a basic GraphQL API that defines the following Query
type:
type Query {
users: [User!]!
}
- If the list is empty, is that because there are zero users, or did an error occur?
- Even if the list is populated, did the API return all users or just a subset?
To answer questions like these, it's helpful for top-level fields of Query
and Mutation
to return "wrapper" objects that can include both the operation result and metadata about the operation's execution.
Comments
0 commentsArticle is closed for comments.