Problem with nested graphql query

Hello,

hope someone can help me with a graphQL query - I don’t get it why it returns the wrong resultset.

My query is:

query allArticleCategories {
  articleCategories(sort: "title:asc", where: { active: true, articles: {status: "published" } }) {
    id
    title
    slug
    articles {
        id
        title
        slug
        status
    }
  }
}

I want to query all active article categories with their published articles in it.

The query works but it returns also articles which are not published.

Where is my mistake?

Thanks for some help!

Best regards,

Timo

I found the solution: I have to filter the subquery.

query allArticleCategories {
  articleCategories(sort: "title:asc", where: { active: true }) {
    id
    title
    slug
    articles(where: { status: "published" }) {
        id
        title
        slug
        status
    }
  }
}