Module: GraphQL::Schema::Member::HasArguments::FieldConfigured Private

Included in:
Field
Defined in:
lib/graphql/schema/member/has_arguments.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#all_argument_definitionsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

[View source]

206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/graphql/schema/member/has_arguments.rb', line 206

def all_argument_definitions
  if @resolver_class
    all_defns = {}
    @resolver_class.all_field_argument_definitions.each do |arg_defn|
      key = arg_defn.graphql_name
      case (current_value = all_defns[key])
      when nil
        all_defns[key] = arg_defn
      when Array
        current_value << arg_defn
      when GraphQL::Schema::Argument
        all_defns[key] = [current_value, arg_defn]
      else
        raise "Invariant: Unexpected argument definition, #{current_value.class}: #{current_value.inspect}"
      end
    end
    all_defns.merge!(own_arguments)
    all_defns = all_defns.values
    all_defns.flatten!
    all_defns
  else
    super
  end
end

#any_arguments?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

[View source]

202
203
204
# File 'lib/graphql/schema/member/has_arguments.rb', line 202

def any_arguments?
  super || (@resolver_class && @resolver_class.any_field_arguments?)
end

#arguments(context = GraphQL::Query::NullContext.instance) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

[View source]

184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/graphql/schema/member/has_arguments.rb', line 184

def arguments(context = GraphQL::Query::NullContext.instance)
  own_arguments = super
  if @resolver_class
    inherited_arguments = @resolver_class.field_arguments(context)
    if own_arguments.any?
      if inherited_arguments.any?
        inherited_arguments.merge(own_arguments)
      else
        own_arguments
      end
    else
      inherited_arguments
    end
  else
    own_arguments
  end
end