Hope everyone does not mind about this naive question. I’m learning GraphDB/Dgraph and followed the “Getting start” https://dgraph.io/docs/get-started to successful setup a local playground.
I’m able to query data using filter and connecting filters on scalar fields, but failed when trying to filter based on existing of list element.
With this query:
{
data(func: type(Film)) @recurse(loop:false)
@filter(eq(director,"George Lucas"))
{
uid
expand(_all_)
}
}
I get the following error:
{
"name": "t",
"url": "http://localhost:8080/query?timeout=20s",
"errors": [
{
"message": ": Got error: Attribute director is not valid scalar type while running: name:\"eq\" args:\"George Lucas\" ",
"extensions": {
"code": "ErrorInvalidRequest"
}
}
]
}
Can someone please help to correct the filter? I’ve tried with @filter(eq(director.name,“George Lucas”)) but got empty data return. I guess director.name is seen as a scalar and not how to indicate the field of the element in the list to search for.
Thank you.