[SOLVED] Getting Invalid Query exception and it's not the 14.0.0 version problem.
- 0
- Databases
- Web
- Cloud
Trying to navigate to a post I made, I get this error: Invalid query: {"method":"equal","attribute":"slug","values":["test-post"]} and I checked if the slugs are the same and they are. Not sure what the problem might be.
---
import { Query } from "appwrite";
import { databases } from "../../lib/appwrite";
import Layout from "../../layouts/Layout.astro";
import Container from "../../components/container.astro";
const { postSlug } = Astro.params;
const { documents } = await databases.listDocuments(
import.meta.env.PUBLIC_DATABASE_ID,
import.meta.env.PUBLIC_COLLECTION_ID,
[Query.equal("slug", String(postSlug))]
);
if (!documents.length) {
return Astro.redirect("/404");
}
const post = documents[0];
const publishedDate = new Date(post.$createdAt);
console.log("documents", documents);
---
<Layout title={`${post.title} - My Blog`}>
<Container>
<article class="prose mx-auto">
<h1 class="text-4xl font-extrabold mb-6">{post.title}</h1>
<p class="text-slate-500 mb-14">
<time datetime={publishedDate.toISOString()}
>Published {publishedDate.toLocaleDateString()}</time
>
</p>
<Fragment set:html={post.content} />
</article>
</Container>
</Layout>
The code above is my [postSlug].astro
You say it’s “not the 14.0.0 version problem”, but that is the Appwrite 1.5 Query syntax. What makes you say it’s not the SDK version?
I downgraded to "appwrite": "^13.0.2", I didn't knew the syntax was different
what should I do?
You should delete the node_modules/ folder, then run npm install again
oh man I thought I already did, but it doesn't seem like it xd
thank you, working now!
🫰
Great! If your issue has been solved, you can mark this post as closed by adding "[SOLVED]" to the beginning of the title
[SOLVED] Getting Invalid Query exception and it's not the 14.0.0 version problem.
Recommended threads
- [Regression] Appwrite 25.1.0 returns Inv...
I've already opened an issue on GitHub, but somewhat it doesn't seem like GitHub is monitored very closely, so I'm leaving a bug report here on Discord as well....
- Helping in unblock my account
I deleted my Appwrite Cloud account that was linked via GitHub. Now I activated my GitHub Student Pack and want to sign up again using the same GitHub account, ...
- Not allowed permission to upsert a prese...
```js const presenceID = ID.unique(); setPID(presenceID); const presence = await presences.upsert({ presenceId: presenceID, status: "online"...