Content Deep Dive
GraphQL filter for filtering entries by linked references
Blog post from Contentful
Post Details
Company
Date Published
Author
Salma Alam-Naylor
Word Count
733
Language
English
Hacker News Points
-
Summary
You want to filter blog posts by linked topic using the GraphQL API, but the documentation states that it's not possible to filter on fields of Type Array<Link>. However, you can use the linkedFrom field to achieve this. To do so, first query your topicCollection and then fetch a single topic by slug. Then, request the blog post collection items that reference the referenced topic using the linkedFrom field. This allows you to effectively retrieve all entries that reference entries of Type Array<Link>.