I want to fetch some data based on the visited url of my blog website . This is the query I am using in the pages I'd like to fetch the data :
export const query = graphql`
query BlogPostQuery($uid: String) {
prismicBlog(uid: { eq: $uid }) {
uid
}
}
`
This also returns a JSON format in my GraphiQL :
{
"data": {
"prismicBlog": {
"uid": "last04"
}
},
"extensions": {}
}
Eventually , this returns only one uid and it's the first uid in my Prismic CMS , so it doesn't fetch data accordingly of the visited url.
Any idea how to solve this ?