Method: GraphQL::Schema::FieldExtension#resolve

Defined in:
lib/graphql/schema/field_extension.rb

#resolve(object:, arguments:, context:) {|object, arguments, memo| ... } ⇒ Object

Called before resolving #field. It should either:

  • yield values to continue execution; OR
  • return something else to shortcut field execution.

Whatever this method returns will be used for execution.

Parameters:

  • object (Object)

    The object the field is being resolved on

  • arguments (Hash)

    Ruby keyword arguments for resolving this field

  • context (Query::Context)

    the context for this query

Yield Parameters:

  • object (Object)

    The object to continue resolving the field on

  • arguments (Hash)

    The keyword arguments to continue resolving with

  • memo (Object)

    Any extension-specific value which will be passed to #after_resolve later

Returns:

  • (Object)

    The return value for this field.



133
134
135
# File 'lib/graphql/schema/field_extension.rb', line 133

def resolve(object:, arguments:, context:)
  yield(object, arguments, nil)
end