class GraphQL::Schema::Validator::InclusionValidator

You can use this to allow certain values for an argument.

Usually, a GraphQL::Schema::Enum is better for this, because itโ€™s self-documenting.

Examples

Example: only allow certain values for an argument

argument :favorite_prime, Integer, required: true,
  validates: { inclusion: { in: [2, 3, 5, 7, 11, ... ] } }