Hello !
I am trying to filter results by content relationship field. I am following the documentation here : Query Data with GraphQL - Prismic
But instead of having the id of the doc hard coded I need to make it a variable.
I have tried to use prismic.load but I must be using it wrong as it is not working.
Here is my query:
export const query = graphql query BlogArticleQuery($lang: String!, $uid: String!, $child: String) { prismic { article: blog_article(lang: $lang, uid: $uid) { ...BlogArticle } recommendation: allBlog_recommendationss { edges { node { recommendation_title } } } categories: allBlog_categorys(where: { child: $child }) { edges { node { category_name child { ... on PRISMIC_Blog_category { category_name _linkType _meta { uid id } } } } } } } }
and inside my component I have:
useEffect(() => {
prismic
.load({
variables: { child: article.category._meta.id }
})
.then(response => {
console.log(response)
}).catch(err=> console.log(err))
})
But it is not working ![]()
Could you help me out ? Thanks a lot in advance !

