AbsintheErrorPayload.ValidationMessageTypes (AbsintheErrorPayload v1.1.4) View Source

This contains absinthe objects used in mutation responses.

To use, import into your Absinthe.Schema files with

import_types AbsintheErrorPayload.ValidationMessageTypes

Objects

:validation_option holds a key value pair. These values are substitutions to be applied to a validation message template


object :validation_option do
  field :key, non_null(:string), description: "..."
  field :value, non_null(:string), description: "..."
end

:validation_message contains all fields included in a AbsintheErrorPayload.ValidationMessage for maximum flexibility.

This is possibly more information than you wish to supply - in that case, rather than importing this Module, you can create your own objects and use them. For example, if you only want to supply interpolated messages, the :template and :options fields are unnecessary.

object :validation_message, description: "..." do
  field :field, :string, description: "..."
  field :message, :string, description: "..."
  field :code, non_null(:string), description: "..."
  field :template, :string, description: "..."
  field :options, list_of(:validation_option), description: "..."
end

Actual descriptions have been ommited for brevity - check the github repo to see them.