Exception: GraphQL::LoadApplicationObjectFailedError

Inherits:
ExecutionError show all
Defined in:
lib/graphql/load_application_object_failed_error.rb

Overview

Raised when a argument is configured with loads: and the client provides an ID, but no object is loaded for that ID.

See Also:

  • A hook which you can override in resolvers, mutations and input objects.

Instance Attribute Summary collapse

Attributes inherited from ExecutionError

#ast_node, #extensions, #options, #path

Instance Method Summary collapse

Methods inherited from ExecutionError

#to_h

Constructor Details

#initialize(argument:, id:, object:) ⇒ LoadApplicationObjectFailedError

Returns a new instance of LoadApplicationObjectFailedError.



15
16
17
18
19
20
# File 'lib/graphql/load_application_object_failed_error.rb', line 15

def initialize(argument:, id:, object:)
  @id = id
  @argument = argument
  @object = object
  super("No object found for `#{argument.graphql_name}: #{id.inspect}`")
end

Instance Attribute Details

#argumentGraphQL::Schema::Argument (readonly)

Returns the argument definition for the argument that was looked up.

Returns:



10
11
12
# File 'lib/graphql/load_application_object_failed_error.rb', line 10

def argument
  @argument
end

#idString (readonly)

Returns The ID provided by the client.

Returns:

  • (String)

    The ID provided by the client



12
13
14
# File 'lib/graphql/load_application_object_failed_error.rb', line 12

def id
  @id
end

#objectObject (readonly)

Returns The value found with this ID.

Returns:

  • (Object)

    The value found with this ID



14
15
16
# File 'lib/graphql/load_application_object_failed_error.rb', line 14

def object
  @object
end