Hello I've got a query`export const postsQuery = `*[_type == "blogs"]`;` which returns the following result:
[
{
cover: { _type: 'image', asset: [Object] },
author: 'Abrar Rauf',
_id: 'd46dcf25-f467-4636-8028-b8a4c1b17001',
body: [ [Object], [Object], [Object], [Object] ],
_updatedAt: '2023-07-27T12:44:54Z',
slug: { current: 'another-blog', _type: 'slug' },
_createdAt: '2023-07-26T11:55:16Z',
_rev: 'cC8oCPRPnURX9jporz2Jb9',
_type: 'blog',
title: 'Another blog'
}
]
I've got a second query `export const postQuery = `*[_type == "blogs" && slug.current == $slug][0]`;` to fetch this individual blog.
const params = {slug: 'another-blog'};
// This is using Sanity client
const post = _await_ getClient().fetch(postQuery, params);
console.log(post);
However this is returning null, is there something I'm doing wrong with the query?