I want to query my data from Directus through GraphQL. I have to two collections Festival
and Artists
which are connected through a many to many relation. In the GUI everything works fine but when I try to query the records through GraphQL I'm not able to retrieve any fields from the related collection. My query looks like this:
query FestivalList($size: Int = 2, $skip: Int = 0) {
model: festival(limit: $size, offset: $skip) {
data {
festivalId
name
artists {
name
}
}
}
}
As response I get following error: Cannot query field "name" on type "FestivalArtistItem".
So how should I query the related data through GraphQL? I'm using Directus 8.8.1