Skip to main content

Action result object

Here's how action result object is structured (all keys are optional):

NameWhenValue
data?Execution is successful.What you returned in action's server code.
validationErrors?Input data doesn't pass validation.An object whose keys are the names of the fields that failed validation. Each key's value is either an VEList or a nested key with an VEList inside.
VEList is defined as: { errors?: string[] }.
It follows the same structure as Zod's format function.
bindArgsValidationErrors?Bind arguments inputs don't pass validation.An array of objects that mirrors the bind schemas array passed to bindArgsSchemas. Each key's value is either an VEList, a nested key with an VEList inside, or null.
VEList is defined as: { errors?: string[] }.
It follows the same structure as Zod's format function.
serverError?An error occurs during action's server code execution.A generic type that by default is the string "Something went wrong while executing the operation." for every server error that occurs, but this is configurable when instantiating a new client.