mikeyseeM
Convex Community2y ago
8 replies
mikeysee

Runtime validation using Convex Types

I asked the AI this but the answer wast very helpful unfortunately.

Is there a way I can validate a type given a convex value so for example if I have:

const userValidator = v.object({
  name: v.string(),
});


I would like to validate that this:

validate(userValidator, { name: 123 })


Would throw an error because name is not of type string
Was this page helpful?