class GraphQL::InvalidNullError

Raised automatically when a field's resolve function returns `nil` for a non-null field.

Attributes

field[R]

@return [GraphQL::Field] The field which failed to return a value

parent_type[R]

@return [GraphQL::BaseType] The owner of {#field}

value[R]

@return [nil, GraphQL::ExecutionError] The invalid value for this field

Public Class Methods

new(parent_type, field, value) click to toggle source
Calls superclass method
# File lib/graphql/invalid_null_error.rb, line 15
def initialize(parent_type, field, value)
  @parent_type = parent_type
  @field = field
  @value = value
  super("Cannot return null for non-nullable field #{@parent_type.name}.#{@field.name}")
end

Public Instance Methods

parent_error?() click to toggle source

@deprecated always false

# File lib/graphql/invalid_null_error.rb, line 28
def parent_error?
  false
end
to_h() click to toggle source

@return [Hash] An entry for the response's “errors” key

# File lib/graphql/invalid_null_error.rb, line 23
def to_h
  { "message" => message }
end