I may be missing something fundamental here, but building queries via Slash’s GraphQL API Explorer seems to limit query filters ONLY to String data types and not via Node/Edge relationships?
In example schema below, you can create a Slash GraphQL query with a filter on NodeX where id = 123, but I seem to be unable to filter on “Only return NodeX’es where their NodeY = 456?”
type NodeX {
id: ID!
name: String @search(by:[fulltext])
nodey: [NodeY] @hasInverse(field:nodex)
}
type NodeY {
id: ID!
name: String @search(by:[fulltext])
nodex: [NodeX] @hasInverse(field:nodey)
}
Expected filtering something like other GraphQL BaaS services offer:
query CorrectDataQuery {
NodeXList(filter: {nodey: {every: {id: {equals: "456"}}}}) {
items {
id
name
}
}
}
But, I’m only allowed to do?:
query ReturnsWrongDataQuery {
queryNodeX {
id
name
nodey(filter: {id: "456"}) {
id
name
}
}
}
Which results in the wrong set of data?
In the example above, you COULD query on NodeY (not NodeX) where id = 456, return that node, AND return its nested, related set of nodeX’s. This may be OK in that instance… but when you want to build rich queries with multiple filters on both string data and node/edge relationship data, that becomes impossible?
The entire reason to use GraphQL – and specifically a graph db-based BaaS like Dgraph – for me was to have rich node/edge data and – hopefully – make it super simple to work with those edge/node relationships? But maybe that is not the case?
Is this a limitation of Dgraph Slash or Dgraph graph database? Or am I missing something basic?
Thanks much.