class Graphiti::Scoping::ExtraAttributes
Public Instance Methods
Source
# File lib/graphiti/scoping/extra_attributes.rb, line 7 def apply each_extra_attribute do |callable| @scope = callable.call(@scope, resource.context) end @scope end
Loop through all requested extra fields. If custom scoping logic is define for that field, run it. Otherwise, do nothing.
@return the scope object we are chaining/modofying
Private Instance Methods
Source
# File lib/graphiti/scoping/extra_attributes.rb, line 17 def each_extra_field resource.extra_fields.each_pair do |name, callable| if extra_fields.include?(name) yield callable end end end
Source
# File lib/graphiti/scoping/extra_attributes.rb, line 25 def extra_fields query_hash[:extra_fields][resource.type] || [] end