So i have 2 custom types
-
authors
--- name
--- slug
--- picture -
posts
--- slug
--- title
--- content
--- author linked with author field above
I want all the posts by author id / slug
useAllPrismicDocumentsByType('posts', {
predicates: [predicate.at('my.posts.author.slug', 'testing-user')],
});
this is what I am trying to use but getting an undefined
if I try with
predicates: [predicate.has('my.posts.author')],
I am getting all docs in array but if I do .uid or .slug at end I again get undefined
predicates: [predicate.has('my.posts.author.uid')],
How can I match the query so posts.author.slug === 'testing-user' ?
thanks