ValidationMessage
Validation messages are returned when mutation input does not meet the requirements. While client-side validation is highly recommended to provide the best User Experience, All inputs will always be validated server-side.
Some examples of validations are:
* Username must be at least 10 characters * Email field does not contain an email address * Birth Date is required
While GraphQL has support for required values, mutation data fields are always set to optional in our API. This allows 'required field' messages to be returned in the same manner as other validations. The only exceptions are id fields, which may be required to perform updates or deletes.
type ValidationMessage {
field: String
message: String
code: String!
template: String
options: [ValidationOption]
}
Fields
ValidationMessage.field
● String
scalar
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 null in cases where an error cannot be applied to a specific field.
ValidationMessage.message
● String
scalar
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
This message may change without notice, so we do not recommend you match against the text. Instead, use the *code* field for matching.
ValidationMessage.code
● String!
non-null scalar
A unique error code for the type of validation used.
ValidationMessage.template
● String
scalar
A template used to generate the error message, with placeholders for option substiution.
Example: Username must be at least {count} characters
This message may change without notice, so we do not recommend you match against the text. Instead, use the *code* field for matching.
ValidationMessage.options
● [ValidationOption]
list object
A list of substitutions to be applied to a validation message template
Member Of
AccountMemberPayload
object ● AccountMembershipPayload
object ● ArtifactPayload
object ● BundlePayload
object ● CloudCostCredentialPayload
object ● DeploymentPayload
object ● EnvironmentConnectionPayload
object ● EnvironmentPayload
object ● GroupPayload
object ● InvitationPayload
object ● LinkPayload
object ● ManifestPayload
object ● OrganizationPayload
object ● PackagePayload
object ● ProjectPayload
object ● RemoteReferencePayload
object ● SecretMetadataPayload
object ● ServiceAccountMemberPayload
object ● ServiceAccountPayload
object ● ServiceAccountWithSecretPayload
object ● TargetConnectionPayload
object ● TargetPayload
object