Skip to content

errors advanced

Everything else the package exports, for when you go beyond its components and hooks, such as your own queries or cache updates. Most projects never need these.

Errors1
ServerMutationErrorError thrown by a feature mutation hook when the backend returns typed errors.
@evolve-storefront/errors/error
Other functions and constants3
mapServerErrorsMap a mutation's typed backend errors to display messages, by code — never from the server message.
@evolve-storefront/errors/map
toFormErrorsTurn a failed mutation into the two error props a form View takes.
@evolve-storefront/errors/to-form-errors
isServerMutationErrorType guard for a ServerMutationError in a mutation's onError.
@evolve-storefront/errors/error
Types6
FieldErrorMapA { field: string[] } map — the shape ui's Form takes as errors.
@evolve-storefront/errors/to-form-errors
FormErrorState
@evolve-storefront/errors/to-form-errors
FieldValidationIssueTier 1 — a single field-level validation issue (FieldValidationIssue).
@evolve-storefront/errors/types
MappedServerErrorsMapped result: per-field messages + an optional form-level message.
@evolve-storefront/errors/types
ResolveErrorCodeA code -> localized message resolver.
@evolve-storefront/errors/types
TypedErrorA permissive shape for one entry of a mutation's xxxErrors union, so any feature's hand-written error type fits without casting.
@evolve-storefront/errors/types

Not listed: 0 props and options types. They appear as the tables on the pages of what they type.