I hope it’s OK to ask a simple question here, I’ve been trying to figure this out with the docs and haven’t been successful.
I can’t tell why my query isn’t returning data from a list. I’m not sure if the issue is in the schema, how the data is represented in the RDFs, or with the query itself.
Here is an example with some dummy data:
Schema:
type BookTitle {
id: String! @id
title: String!
book: Book @hasInverse(field: bookTitles)
}
type Book {
id: String! @id
bookTitles: [BookTitle]! @hasInverse(field: book)
}
The hasInverse directive does not use the reverse index. Instead it creates two actual inverse edges and manages them in the API layer. So when you add the rdf triples, you need to add both edges for every relationship having the hasInverse directive.
Check out this script to maybe help you fix the missing relationships: