Multiple use of queryContent
returns null
value.
#2159
anuzpandey
started this conversation in
General
Replies: 2 comments 3 replies
-
This #1368 (comment) states: If you want to use multiple fetch/find inside And as far as I see, you first query for categories and then query for snippets and blog posts, in all examples. (This might be outdated, as the issue is from a year ago.) |
Beta Was this translation helpful? Give feedback.
3 replies
-
So a small workaround I did is, I queried the first statement, which was working as expected. And rather than filtering through javascript side. I did it on Implementation: <ContentList
:query="{
where: {
category: { $in: [data?.pageCategory.title] }
},
$sensitivity: 'base',
sort: [{ id: -1 }]
}"
path="/snippets"
>
<template #default="{ list }">
<div
v-for="(snippet, snippetIndex) in list"
:key="snippetIndex"
>
<!-- Other Codes -->
</div>
</template>
<template #not-found>
<p>No snippets found.</p>
</template>
</ContentList> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So I have a page called category with slug and I'm filtering blogs and snippets with that slug. When I query the category from
content/categories.json
, the value is returned properly but when I add additional queryqueryContent
to fetch snippets and blogs, I get null value for same thing.My current implementation:
But when I remove the additional blog and snippets query, the value is available
I even tried
Promise.all()
for this but no success.This too returns
null
.Any help would be great. Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions