-
Notifications
You must be signed in to change notification settings - Fork 55
Closed
Description
Say I want to find all Humans who have a relationship with a Droid which appeared in A New Hope.
The README has this:
query {
Humans {
select {
name
favoriteDroid(where: {appearsIn: {IN:[A_NEW_HOPE]}}) {
name
}
}
}
}
Which returns:
{
"Humans": {
"select": [
{
"name": "Luke Skywalker",
"favoriteDroid": {
"name": "C-3PO"
}
},
{
"name": "Darth Vader",
"favoriteDroid": {
"name": "R2-D2"
}
}
]
}
but, I just want the Humans. I don't want any info on the Droids. Sure, it works, I can just look at the top-level Humans but there's a load of nested JSON I don't want which will get created, sent over the network and parsed. (In our real db this is much bigger!)
In the query above I have to provide at least one Droid field - either empty braces or removing the braces fails graphiql's schema validation.
Am I missing a way to do this?
Thanks.