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.



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/graphql/schema/member/has_arguments.rb', line 174

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:



170
171
172
# File 'lib/graphql/schema/member/has_arguments.rb', line 170

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.



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/graphql/schema/member/has_arguments.rb', line 152

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