Hi, i am trying to write the smartest query possible using Predicates. I read this article on querying content relationships: Prismic’s documentation for PHP, Laravel, Java, .NET, and Ruby has moved to GitHub - Prismic
I have s custom content type called applications. Every application (grandchild) belongs to an application cluster (child) which further belongs to an industry (parent, also custom content types). Application areas (children) are referenced as a linked document (content relationship) in the application (grandchild).
I no want to query all applications linked to a certain industry. My idea was to do this as follows:
-
as applications are grandchildren of an industry i first query all application areas
-
i use the array of application areas to retrieve all referenced applications
[
Predicates::at('document.type', 'application'),
Predicates::at('my.application.application_area.category_link', ['area-id-1', 'area-id-2', '…])
]
Using multiple values for the category_link query does not seem to work. Is there a smarter way to retrieve the data than just doing a single query for every linked category?