Sha256: 54dcd376284fcc870ac009c44c4531c42d80746a70a919699276358a9901118a

Contents?: true

Size: 1.3 KB

Versions: 131

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true
require "graphql/query/serial_execution/value_resolution"
require "graphql/query/serial_execution/field_resolution"
require "graphql/query/serial_execution/operation_resolution"
require "graphql/query/serial_execution/selection_resolution"

module GraphQL
  class Query
    class SerialExecution
      # This is the only required method for an Execution strategy.
      # You could create a custom execution strategy and configure your schema to
      # use that custom strategy instead.
      #
      # @param ast_operation [GraphQL::Language::Nodes::OperationDefinition] The operation definition to run
      # @param root_type [GraphQL::ObjectType] either the query type or the mutation type
      # @param query_object [GraphQL::Query] the query object for this execution
      # @return [Hash] a spec-compliant GraphQL result, as a hash
      def execute(ast_operation, root_type, query_object)
        operation_resolution.resolve(
          query_object.irep_selection,
          root_type,
          query_object
        )
      end

      def field_resolution
        self.class::FieldResolution
      end

      def operation_resolution
        self.class::OperationResolution
      end

      def selection_resolution
        self.class::SelectionResolution
      end
    end
  end
end

Version data entries

131 entries across 131 versions & 1 rubygems

Version Path
graphql-1.7.0 lib/graphql/query/serial_execution.rb
graphql-1.6.8 lib/graphql/query/serial_execution.rb
graphql-1.6.7 lib/graphql/query/serial_execution.rb
graphql-1.6.6 lib/graphql/query/serial_execution.rb
graphql-1.6.5 lib/graphql/query/serial_execution.rb
graphql-1.6.4 lib/graphql/query/serial_execution.rb
graphql-1.5.15 lib/graphql/query/serial_execution.rb
graphql-1.6.3 lib/graphql/query/serial_execution.rb
graphql-1.6.2 lib/graphql/query/serial_execution.rb
graphql-1.6.1 lib/graphql/query/serial_execution.rb
graphql-1.6.0 lib/graphql/query/serial_execution.rb
graphql-1.5.14 lib/graphql/query/serial_execution.rb
graphql-1.5.13 lib/graphql/query/serial_execution.rb
graphql-1.5.7.1 lib/graphql/query/serial_execution.rb
graphql-1.5.12 lib/graphql/query/serial_execution.rb
graphql-1.5.11 lib/graphql/query/serial_execution.rb
graphql-1.5.10 lib/graphql/query/serial_execution.rb
graphql-1.5.9 lib/graphql/query/serial_execution.rb
graphql-1.5.8 lib/graphql/query/serial_execution.rb
graphql-1.5.7 lib/graphql/query/serial_execution.rb