Method: GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments#get_argument

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

#get_argument(argument_name, 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.



159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/graphql/schema/member/has_arguments.rb', line 159

def get_argument(argument_name, context = GraphQL::Query::NullContext.instance)
  warden = Warden.from_context(context)
  skip_visible = context.respond_to?(:types) && context.types.is_a?(GraphQL::Schema::Visibility::Profile)
  for ancestor in ancestors
    if ancestor.respond_to?(:own_arguments) &&
      (a = ancestor.own_arguments[argument_name]) &&
      (skip_visible || (a = Warden.visible_entry?(:visible_argument?, a, context, warden)))
      return a
    end
  end
  nil
end