I'm new in Graphql and i'd like to know if there is a way to return an empty array instead of null in a relation. Let pick the classic example with User and Post
type User {
id: ID!
posts: [Post]
}
Type Post {
id: ID!
comment: String!
}
when i make a query on an user without any post i'd like to have an empty array on posts attribute, but now i get null
, how can i do that?
Thanks in advance.