lib/rails/graphql/request/helpers/selection_set.rb
# Helper parser for selection fields that also asssign the actual
# field defined under the schema structure
Helper parser for selection fields that also asssign the actual
field defined under the schema structure
Helper parser for selection fields that also asssign the actual field defined under the schema structure
def parse_selection
            @selection = {}
            assigners = Hash.new { |h, k| h[k] = [] }
            visitor.collect_fields(*data[:selection]) do |kind, node, data|
              component = add_component(kind, node, data)
              assigners[component.name] << component if component.assignable?
            end unless data[:selection].nil? || data[:selection].null?
            assing_fields!(assigners)
            @selection.freeze
          end
def parse_selection @selection = { } assigners = Hash . new { | h , k | h [ k ] = [ ] } visitor . collect_fields ( * data [ :selection ] ) do | kind , node , data | component = add_component ( kind , node , data ) assigners [ component . name ] << component if component . assignable? end unless data [ :selection ] . nil? || data [ :selection ] . null? assing_fields! ( assigners ) @selection . freeze end
Helper parser for selection fields that also asssign the actual
field defined under the schema structure
Helper parser for selection fields that also asssign the actual field defined under the schema structure