[Convex Ents] patch not working + patch has not correct typescript definitions

I wrote this code:

messages.ts

export const deleteMessage = mutation({
  args: { messageId: v.string() },
  handler: async (ctx, args) => {
    const parsedMessageId = ctx.table("messages").normalizeId(args.messageId);

    if (!parsedMessageId) {
      throw new ConvexError("chatId was invalid");
    }

    console.log(args.messageId);

    (await ctx.table("messages").getX(parsedMessageId)).patch({
      content: undefined,
      deleted: true,
    });
  },
});


schema.ts

  messages: defineEnt({})
    .field("content", v.string())
    .field("deleted", v.boolean(), { default: false })
    .edge("privateChat")
    .edge("user"),


And as you can see in the image the mutation is called correctly. But message does not get patched.
image.png
image.png
Was this page helpful?