lib/rails/graphql/request.rb
# This executes the whole process capturing any exceptions and handling
# them as defined by the schema
This executes the whole process capturing any exceptions and handling
them as defined by the schema
This executes the whole process capturing any exceptions and handling them as defined by the schema
def execute!(document)
          log_execution(document) do
            @document = GraphQL::Native.parse(document)
            collect_definitions!
            @strategy = find_strategy!
            @strategy.trigger_event(:request)
            @strategy.resolve!
          end
        rescue ParseError => err
          parts = err.message.match(/\A(\d+)\.(\d+)(?:-\d+)?: (.*)\z/)
          errors.add(parts[3], line: parts[1], col: parts[2])
        ensure
          @cache.clear
          @fragments.clear
          @operations.clear
          @visitor.terminate
          @visitor = nil
          GraphQL::Native.free_node(@document) if defined?(@document)
          @response.try(:append_errors, errors)
        end
def execute! ( document ) log_execution ( document ) do @document = GraphQL :: Native . parse ( document ) collect_definitions! @strategy = find_strategy! @strategy . trigger_event ( :request ) @strategy . resolve! end rescue ParseError => err parts = err . message . match ( / \A ( \d +) \. ( \d +)(?:- \d +)?: (.*) \z / ) errors . add ( parts [ 3 ] , line : parts [ 1 ] , col : parts [ 2 ] ) ensure @cache . clear @fragments . clear @operations . clear @visitor . terminate @visitor = nil GraphQL :: Native . free_node ( @document ) if defined? ( @document ) @response . try ( :append_errors , errors ) end
This executes the whole process capturing any exceptions and handling
them as defined by the schema
This executes the whole process capturing any exceptions and handling them as defined by the schema
document