'Doubts on how to filter a list of items in GraphQL based on nested array containing a specific value
I have a GraphQL query which returns a list of items (e.g. Actors) which might have a list of items nested under it (e.g. Film where they have been acting).
So actors have FILMS nested which is an ARRAY of films where the Actor has appeared.
I'd like to run a GraphQL query which returns all Actors which have been acting on the same film. Anyway when I run the query I receive only those which have been acting in and only the film I am using in the where clause.
query get_actors_by_film(
$film_ID: ID!
) {
actors(
where: {
films: {id:$film_ID}
}
)
{
id
name
films {
id
title
}
}
}
Is there a way to do this? I have the impression that I am missing something.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
