Exception: GraphQL::UnauthorizedEnumValueError

Inherits:
UnauthorizedError show all
Defined in:
lib/graphql/unauthorized_enum_value_error.rb

Instance Attribute Summary collapse

Attributes inherited from UnauthorizedError

#context, #object, #type

Instance Method Summary collapse

Constructor Details

#initialize(type:, context:, enum_value:) ⇒ UnauthorizedEnumValueError

Returns a new instance of UnauthorizedEnumValueError.



7
8
9
10
11
# File 'lib/graphql/unauthorized_enum_value_error.rb', line 7

def initialize(type:, context:, enum_value:)
  @enum_value = enum_value
  message ||= "#{enum_value.path} failed authorization"
  super(message, object: enum_value.value, type: type, context: context)
end

Instance Attribute Details

#enum_valueGraphQL::Schema::EnumValue

Returns The value whose #authorized? check returned false.

Returns:



5
6
7
# File 'lib/graphql/unauthorized_enum_value_error.rb', line 5

def enum_value
  @enum_value
end