-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
exp/beginnerSomething most people could solve.Something most people could solve.kind/enhancementSomething could be better.Something could be better.
Description
According to the GraphQL specs it is possible to define non nullable types: http://facebook.github.io/graphql/October2016/#sec-Types.Non-Null
According to this source here, this can also be applied for lists: https://graphql.org/learn/schema/#lists-and-non-null
This feature is very helpful when dealing with missing relations, e.g. here:
{
objectives(func: uid(XXXX))
uid
lead {
uid
fullName
}
}
The query result looks currently like this:
"data": {
"objectives": [{
"uid": "XXXXX"
}]
},
But this would simplify the handling in the frontend since you don't have to deal with the undefined case anymore:
"data": {
"objectives": [{
"uid": "XXXXX",
"objective_lead": []
}]
},
Since this could be done by changing the schema, it would have no effect for existing users of dgraph.
clery, dbreucker, jostillmanns, spsneo and vkatushenok
Metadata
Metadata
Assignees
Labels
exp/beginnerSomething most people could solve.Something most people could solve.kind/enhancementSomething could be better.Something could be better.