Howto query in GraphQL for entries related to categories based on selection of categories in an entry? #9849
-
Can anybody tell me how to query in GraphQL the entries related to a category, from an entry with some of those categories selected? So I have for example:
I'm querying for the article with an Because this gives me only the categories, but I want the entries in those categories: entry(section: "articles", slug: "more-beer") {
id
title
uri
... on articles_Entry {
productCategories {
id
title
}
}
} Can't figure it out, tried some things with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You would need to run a separate query for that. The Something like
should work. |
Beta Was this translation helpful? Give feedback.
You would need to run a separate query for that. The
entry
query for the main entry to display and the other one to get the entries related to the category.Something like
should work.