Hello,
[BACKGROUND]
So we have such a schema
interface Node {
id: String! @id
}
interface Thing {
name: String! @search(by:[fulltext])
description: String @search(by:[fulltext])
}
interface Member{
id: ID!
member: [Member!]
memberOf: [Member!] @hasInverse(field: member)
}
type Person implements Thing & Member{
email: String! @search(by:[fulltext]) @id
}
type Organization implements Thing & Member{
vatID: String
}
type Brand implements Thing & Member {
aggregateRating: Float
}
And now I have query
queryPerson {
id
email
name,
memberOf {
id
... on Thing {
name
}
}
}
Runs smoothly.
But what if I would like to filter members by name? It is not in Member interface but is in Thing.
I cannot add name property to Member because it will fail as types inhertis from Thing and Member.
So such query is impossible
queryPerson {
id
email
name,
memberOf(filter: { name: { anyofterms: "test" } }) {
id
... on Thing {
name
}
}
}
.
Seems like union here would be better option as it generates filter you can specify per type.
But union cannot have @hasInverse attribute and I feel it inconvenient.
So I am missing probably interface inhertiance but maybe you could guide me and change way of thinking, please.