lib/rails/graphql/request/helpers/directives.rb
# Helper parser for directives that also collect necessary variables
Helper parser for directives that also collect necessary variables
Helper parser for directives that also collect necessary variables
def parse_directives(location = nil)
            list = []
            visitor.collect_directives(*data[:directives]) do |data|
              instance = find_directive!(data[:name])
              args = directive_arguments(instance)
              args = collect_arguments(args, data[:arguments]) do |errors|
                "Invalid arguments for @#{instance.gql_name} directive" \
                  " added to #{gql_name} #{kind}: #{errors}."
              end
              list << instance.new(request.build(Request::Arguments, args))
            end unless data[:directives].blank?
            if list.present?
              event = Event.new(:attach, strategy, self, phase: :execution)
              list = GraphQL.directives_to_set(list, [], event, location: location || kind)
            end
            @directives = list.freeze
          end
def parse_directives ( location = nil ) list = [ ] visitor . collect_directives ( * data [ :directives ] ) do | data | instance = find_directive! ( data [ :name ] ) args = directive_arguments ( instance ) args = collect_arguments ( args , data [ :arguments ] ) do | errors | "Invalid arguments for @#{instance.gql_name} directive" " added to #{gql_name} #{kind}: #{errors}." end list << instance . new ( request . build ( Request :: Arguments , args ) ) end unless data [ :directives ] . blank? if list . present? event = Event . new ( :attach , strategy , self , phase : :execution ) list = GraphQL . directives_to_set ( list , [ ] , event , location : location || kind ) end @directives = list . freeze end
Helper parser for directives that also collect necessary variables
Helper parser for directives that also collect necessary variables
location