Method: GraphQL::Current.field

Defined in:
lib/graphql/current.rb

.fieldGraphQL::Field?

Returns The currently-running field, if there is one.

Returns:

  • (GraphQL::Field, nil)

    The currently-running field, if there is one.

See Also:

  • for a string identifying this field


43
44
45
# File 'lib/graphql/current.rb', line 43

def self.field
  Fiber[:__graphql_runtime_info]&.values&.first&.current_field
end