Use cascade, this works !! Because you have applied filter after printing names , so the players which don’t have attribute “dexterity” also gets printed. And for them attribute name results null, and it gives error while printing because attribute field is non null in graphql schema. Cascade returns the results which matches all the filters/conditions in query and reject partial matches.
query {
queryPlayer@cascade {
name
attributes {
attribute(filter: {name: {eq: "dexterity"}}) {
name
}
}
}
}
{
"data": {
"queryPlayer": [
{
"name": "John",
"attributes": [
{
"attribute": {
"name": "dexterity"
}
}
]
}
]
},
"extensions": {
"touched_uids": 19
}
}