Method: GraphQL::Schema::FieldExtension#initialize

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

#initialize(field:, options:) ⇒ FieldExtension

Called when the extension is mounted with extension(name, options). The instance will be frozen to avoid improper use of state during execution.

Parameters:

  • field (GraphQL::Schema::Field)

    The field where this extension was mounted

  • options (Object)

    The second argument to extension, or {} if nothing was passed.



25
26
27
28
29
30
# File 'lib/graphql/schema/field_extension.rb', line 25

def initialize(field:, options:)
  @field = field
  @options = options || {}
  @added_default_arguments = nil
  apply
end