Aguiarti
CCConvex Community
•Created by Aguiarti on 5/23/2024 in #support-community
Error: Unable to run schema validation
Hey team, I'm getting an
Error: Unable to run schema validation on https://charming-armadillo-264.convex.cloud
Error fetching POST https://charming-armadillo-264.convex.cloud/api/prepare_schema 403 Forbidden: BadDeployKey: The provided deploy key was invalid for deployment 'charming-armadillo-264'. Double check that the environment this key was generated for matches the desired deployment.
this is the query I added
export const getByDocumentId = query({
args: {
document_id: v.string(),
},
handler: async (ctx, args) => {
const identity = await ctx.auth.getUserIdentity();
if (!identity) {
throw new Error("Unauthorized");
}
if (!args.document_id) {
throw new Error("Document ID is missing");
}
const documents = await ctx.db
.query("documents")
.filter((q) => q.eq(q.field("document_id"), args.document_id))
.collect();
return documents;
},
});
any hints?3 replies
CCConvex Community
•Created by Aguiarti on 5/22/2024 in #support-community
idempotent mutation
Hey folks, is there any way to make an idempotent mutation? I want to update a row documents based on the document_id (custom column), if not there, create a new one. Couldn't find anything in the docs, any hints?
7 replies