I'm learning GraphQL now and while walking through tutorial I met behavior that I can't understand. Let's say we have defined type in schema:
type Link {
id: ID!
url: String!
description: String!
postedBy: User
votes: [Vote!]!
}
Due to docs votes: [Vote!]!
means that that field should be a non-nullable and array itself should be non-nullable too. But just after that author of tutorial shows example of query and for some of links it returns empty array for votes
field. Like this:
{
"url": "youtube.com",
"votes": []
},
{
"url": "agar.io",
"votes": []
}
So my question is: Doesn't "non-nullable" means "empty" in graphQL schema or it's just some kind of wrong behavior of graphQL server (I mean it returns array of nothing without warning that there should be something due to schema).
Thanks!