Sha256: f256e00def04a9f38df5b7519f7d84dba6a373bf1fa9be5f8622866d0b87a58f

Contents?: true

Size: 1.75 KB

Versions: 43

Compression:

Stored size: 1.75 KB

Contents

# frozen_string_literal: true
module GraphQL
  module Tracing
    # This is the base class for a `trace` instance whose methods are called during query execution.
    # "Trace modes" are subclasses of this with custom tracing modules mixed in.
    #
    # A trace module may implement any of the methods on `Trace`, being sure to call `super`
    # to continue any tracing hooks and call the actual runtime behavior. See {GraphQL::Backtrace::Trace} for example.
    #
    class Trace
      # @param multiplex [GraphQL::Execution::Multiplex, nil]
      # @param query [GraphQL::Query, nil]
      def initialize(multiplex: nil, query: nil, **_options)
        @multiplex = multiplex
        @query = query
      end

      # The Ruby parser doesn't call this method (`graphql/c_parser` does.)
      def lex(query_string:)
        yield
      end

      def parse(query_string:)
        yield
      end

      def validate(query:, validate:)
        yield
      end

      def analyze_multiplex(multiplex:)
        yield
      end

      def analyze_query(query:)
        yield
      end

      def execute_multiplex(multiplex:)
        yield
      end

      def execute_query(query:)
        yield
      end

      def execute_query_lazy(query:, multiplex:)
        yield
      end

      def execute_field(field:, query:, ast_node:, arguments:, object:)
        yield
      end

      def execute_field_lazy(field:, query:, ast_node:, arguments:, object:)
        yield
      end

      def authorized(query:, type:, object:)
        yield
      end

      def authorized_lazy(query:, type:, object:)
        yield
      end

      def resolve_type(query:, type:, object:)
        yield
      end

      def resolve_type_lazy(query:, type:, object:)
        yield
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
graphql-2.4.7 lib/graphql/tracing/trace.rb
graphql-2.4.6 lib/graphql/tracing/trace.rb
graphql-2.4.5 lib/graphql/tracing/trace.rb
graphql-2.4.4 lib/graphql/tracing/trace.rb
graphql-2.4.3 lib/graphql/tracing/trace.rb
graphql-2.4.2 lib/graphql/tracing/trace.rb
graphql-2.4.1 lib/graphql/tracing/trace.rb
graphql-2.4.0 lib/graphql/tracing/trace.rb
graphql-2.3.20 lib/graphql/tracing/trace.rb
graphql-2.3.19 lib/graphql/tracing/trace.rb
graphql-2.3.18 lib/graphql/tracing/trace.rb
graphql-2.3.17 lib/graphql/tracing/trace.rb
graphql-2.3.16 lib/graphql/tracing/trace.rb
graphql-2.3.15 lib/graphql/tracing/trace.rb
graphql-2.3.14 lib/graphql/tracing/trace.rb
graphql-2.3.13 lib/graphql/tracing/trace.rb
graphql-2.3.12 lib/graphql/tracing/trace.rb
graphql-2.3.11 lib/graphql/tracing/trace.rb
graphql-2.3.10 lib/graphql/tracing/trace.rb
graphql-2.2.16 lib/graphql/tracing/trace.rb