AbsintheErrorPayload.ValidationMessage (AbsintheErrorPayload v1.1.4) View Source

Stores validation message information.



The input field that the error applies to. The field can be used to identify which field the error message should be displayed next to in the presentation layer.

If there are multiple errors to display for a field, multiple validation messages will be in the result.

This field may be nil in cases where an error cannot be applied to a specific field.


A friendly error message, appropriate for display to the end user.

The message is interpolated to include the appropriate variables.

Example: "Username must be at least 10 characters"


A template used to generate the error message, with placeholders for option substiution.

Example: "Username must be at least %{count} characters"


A unique error code for the type of validation that failed. This field must be provided.

See AbsintheErrorPayload.ChangesetParser.to_code/1 for built in codes corresponding to most Ecto validations.


A list of key value pair to be applied to a validation message template. The structure is a list of %{key: _, value: _} to be able to serialize to a GraphQL type


Deprecated, use :field instead