module GraphQL::Schema::Member::HasArguments::ArgumentObjectLoader
Public Instance Methods
# File lib/graphql/schema/member/has_arguments.rb, line 418 def load_application_object(argument, id, context) # See if any object can be found for this ID if id.nil? return nil end object_from_id(argument.loads, id, context) end
# File lib/graphql/schema/member/has_arguments.rb, line 512 def load_application_object_failed(err) raise err end
Called when an argumentβs loads: configuration fails to fetch an application object. By default, this method raises the given error, but you can override it to handle failures differently.
API: public
Parameters
-
err(GraphQL::LoadApplicationObjectFailedError) β The error that occurred
Returns
-
Object, nilβ If a value is returned, it will be used instead of the failed load
# File lib/graphql/schema/member/has_arguments.rb, line 414 def object_from_id(type, id, context) context.schema.object_from_id(id, context) end
Look up the corresponding object for a provided ID. By default, it uses Relay-style Schema.object_from_id, override this to find objects another way.
Parameters
-
type(Class, Module) β AGraphQLtype definition -
id(String) β A client-provided to look up -
context(GraphQL::Query::Context) β the current context