I'd life for it to be a single query somewhat like this, but I do not know how to get the author part working since it refers to articles and review. Is there a way to accomplish this like the line with the comment?
const response= await client.query([
Prismic.Predicates.at("document.type", "article"),
Prismic.Predicates.at("my.document.author", `${props.id}`), //my.document.author is not possible
]);
I understand how to sort using the method you provided, but that is useless in my situation. My intention is to combine both articles and reviews into one array sorted by date. If I cannot query them both together my only option is to use a sort function after the query because otherwise I would have two separately sorted arrays of articles and reviews respectively.
As you've discovered there is no way currently to combine both articles and reviews into one array. The only way is the one you suggested: making two separate queries and combining the results.
Thanks,
Priyanka
system
(system)
closed as resolved, flag & select 'Something Else' to reopen.
6
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.