Can we use zodToConvex with defineEnt when defining ent schema?
Below is the error
TS error:
npx convex dev error:
Here is the schema
TS error:
Argument of type 'ObjectValidator<{ name: Validator<string, false, never>; }>' is not assignable to parameter of type 'Record<string, Validator<any, any, any>>'.
Index signature for type 'string' is missing in type 'Validator<{ name: string; }, false, "name">'.tArgument of type 'ObjectValidator<{ name: Validator<string, false, never>; }>' is not assignable to parameter of type 'Record<string, Validator<any, any, any>>'.
Index signature for type 'string' is missing in type 'Validator<{ name: string; }, false, "name">'.tnpx convex dev error:
InvalidSchema: Hit an error while evaluating your schema:
Invalid validator for key `json`: Not a field validator InvalidSchema: Hit an error while evaluating your schema:
Invalid validator for key `json`: Not a field validatorHere is the schema
const schema = defineEntSchema({
users: defineEnt({
name: v.string(),
})
.edges("messages", { ref: true }),
messages: defineEnt({
text: v.string()
})
.edge("user"),
tags: defineEnt(zodToConvex(z.object({
name: z.string(),
}))),
});const schema = defineEntSchema({
users: defineEnt({
name: v.string(),
})
.edges("messages", { ref: true }),
messages: defineEnt({
text: v.string()
})
.edge("user"),
tags: defineEnt(zodToConvex(z.object({
name: z.string(),
}))),
});