Hello friends,
For some reason, I'm unable to use advanced nested filtering in my schema. What am I doing wrong?
Schema
type User {
managedPodcasts: [UserPodcastEditorOf]
...
}
type Podcast {
editors: [UserPodcastEditorOf]
...
}
type UserPodcastEditorOf @relation(name: "EDITOR_OF") {
from: User
to: Podcast
...
}
Query
Podcast(podcastId: $podcastId, first: 1) {
editors(filter: { User: { uuid: $uuid } }) {
User {
uuid
}
}
}
Result
"Podcast": [
{
"editors": [] <-- No luck!
}
]
However, if I remove filters from editors, I get one result:
New query
Podcast(podcastId: $podcastId, first: 1) {
editors { # Notice the absence of filters
User {
uuid
}
}
}
Result
"Podcast": [
{
"editors": [
{
"User": {
"uuid": "some_uuid" <-- Luck
}
}
]
}
]
Strangely enough, filtering from User through the relationship to Podcast ("managedPodcasts") with a similar filter works fine. So:
User(uuid: $uuid, first: 1) {
managedPodcasts(filter: { Podcast: { podcastId: $podcastId } }) {
podcastId
}
}
does yield results.
Any help is highly appreciated.
Kind regards,
M