class GraphQL::Schema::Validator::AllValidator

Use this to validate each member of an array value.

Examples

Example: validate format of all strings in an array

argument :handles, [String],
  validates: { all: { format: { with: /\A[a-z0-9_]+\Z/ } } }

Example: multiple validators can be combined

argument :handles, [String],
  validates: { all: { format: { with: /\A[a-z0-9_]+\Z/ }, length: { maximum: 32 } } }

Example: any type can be used

argument :choices, [Integer],
  validates: { all: { inclusion: { in: 1..12 } } }