Hello,
I'm currently experiencing an issue with typing the content relationships field. The properties within the "data" attribute of the linked document are not correctly typed.
Below is my type declaration:
type BlogPostCategoryDocumentWithRelation = Content.BlogPostCategoryDocument & {
data: {
popular_posts: {
post: {
data: Pick<Content.BlogPostDocument['data'], 'title' | 'preview_image'>;
};
};
};
};
The "popular_posts" is an array of "post" that has content relationships with the "blog_post" documents. When I attempt to access the "title" attribute of the “post.data”, it displays "Property 'title' does not exist on type '{}'. I am new to TypeScript and would appreciate any guidance on what I could be doing incorrectly.
Thank you.