I am using the tutorial schema of:
type Task {
id: ID!
title: String! @search(by: [fulltext])
completed: Boolean! @search
user: User!
}
type User {
username: String! @id @search(by: [hash])
name: String
tasks: [Task] @hasInverse(field: user)
}
and running the query:
query MyQuery {
queryTask {
user(filter: {username: {eq: "alice@dgraph.io"}}) {
username
}
}
}
gives the error:
"errors": [
{
"message": "Non-nullable field 'user' (type User!) was not present in result from Dgraph. GraphQL error propagation triggered.",
"locations": [
{
"line": 3,
"column": 5
}
],
"path": [
"queryTask",
2,
"user"
]
},
{
"message": "Non-nullable field 'user' (type User!) was not present in result from Dgraph. GraphQL error propagation triggered.",
"locations": [
{
"line": 3,
"column": 5
}
],
"path": [
"queryTask",
3,
"user"
]
},
{
"message": "Non-nullable field 'user' (type User!) was not present in result from Dgraph. GraphQL error propagation triggered.",
"locations": [
{
"line": 3,
"column": 5
}
],
"path": [
"queryTask",
4,
"user"
]
},
{
"message": "Non-nullable field 'user' (type User!) was not present in result from Dgraph. GraphQL error propagation triggered.",
"locations": [
{
"line": 3,
"column": 5
}
],
"path": [
"queryTask",
5,
"user"
]
},
{
"message": "Non-nullable field 'user' (type User!) was not present in result from Dgraph. GraphQL error propagation triggered.",
"locations": [
{
"line": 3,
"column": 5
}
],
"path": [
"queryTask",
6,
"user"
]
}
],
"data": {
"queryTask": [
{
"user": {
"username": "alice@dgraph.io"
}
},
{
"user": {
"username": "alice@dgraph.io"
}
},
null,
null,
null,
null,
null
]
},
"extensions": {
"touched_uids": 19,
"tracing": {
"version": 1,
"startTime": "2021-06-07T03:05:14.398709351Z",
"endTime": "2021-06-07T03:05:14.400413034Z",
"duration": 1703705,
"execution": {
"resolvers": [
{
"path": [
"queryTask"
],
"parentType": "Query",
"fieldName": "queryTask",
"returnType": "[Task]",
"startOffset": 111457,
"duration": 1538085,
"dgraph": [
{
"label": "query",
"startOffset": 169347,
"duration": 1443267
}
]
}
]
}
}
}
}
FWIW, without the filter the query:
query MyQuery {
queryTask {
user {
username
}
}
}
returns
{
"data": {
"queryTask": [
{
"user": {
"username": "alice@dgraph.io"
}
},
{
"user": {
"username": "alice@dgraph.io"
}
},
{
"user": {
"username": "email@example.com"
}
},
{
"user": {
"username": "email@example.com"
}
},
{
"user": {
"username": "email@example.com"
}
},
{
"user": {
"username": "email@example.com"
}
},
{
"user": {
"username": "alice@graph.io"
}
}
]
},
"extensions": {
"touched_uids": 20,
"tracing": {
"version": 1,
"startTime": "2021-06-07T03:06:03.144379984Z",
"endTime": "2021-06-07T03:06:03.146002789Z",
"duration": 1622823,
"execution": {
"resolvers": [
{
"path": [
"queryTask"
],
"parentType": "Query",
"fieldName": "queryTask",
"returnType": "[Task]",
"startOffset": 83378,
"duration": 1488732,
"dgraph": [
{
"label": "query",
"startOffset": 124075,
"duration": 1400160
}
]
}
]
}
}
}
}