Method: GraphQL::Schema::FieldExtension#after_resolve

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

#after_resolve(object:, arguments:, context:, value:, memo:) ⇒ Object

Called after #field was resolved, and after any lazy values (like Promises) were synced, but before the value was added to the GraphQL response.

Whatever this hook returns will be used as the return value.

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

  • value (Object)

    Whatever the field previously returned

  • memo (Object)

    The third value yielded by #resolve, or nil if there wasn't one

Returns:

  • (Object)

    The return value for this field.



148
149
150
# File 'lib/graphql/schema/field_extension.rb', line 148

def after_resolve(object:, arguments:, context:, value:, memo:)
  value
end