Module: GraphQL::Schema::Member::HasArguments::ClassConfigured::InheritedArguments Private

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.



148
149
150
151
152
153
154
155
156
157
158
# File 'lib/graphql/schema/member/has_arguments.rb', line 148

def all_argument_definitions
  all_defns = {}
  ancestors.reverse_each do |ancestor|
    if ancestor.respond_to?(:own_arguments)
      all_defns.merge!(ancestor.own_arguments)
    end
  end
  all_defns = all_defns.values
  all_defns.flatten!
  all_defns
end

#arguments(context = GraphQL::Query::NullContext) ⇒ 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.



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/graphql/schema/member/has_arguments.rb', line 132

def arguments(context = GraphQL::Query::NullContext)
  own_arguments = super
  inherited_arguments = superclass.arguments(context)

  if own_arguments.any?
    if inherited_arguments.any?
      # Local definitions override inherited ones
      inherited_arguments.merge(own_arguments)
    else
      own_arguments
    end
  else
    inherited_arguments
  end
end

#get_argument(argument_name, context = GraphQL::Query::NullContext) ⇒ 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.



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

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