Sha256: df776227649c48038327a70871ca1338ed64e43979b7c96f6769bd1d7ba1de2a

Contents?: true

Size: 835 Bytes

Versions: 25

Compression:

Stored size: 835 Bytes

Contents

module GraphQL
  class Query
    class SerialExecution
      class ExecutionContext
        attr_reader :query, :schema, :strategy

        def initialize(query, strategy)
          @query = query
          @schema = query.schema
          @strategy = strategy
        end

        def get_type(type)
          @schema.types[type]
        end

        def get_fragment(name)
          @query.fragments[name]
        end

        def get_field(type, irep_node)
          # fall back for dynamic fields (eg __typename)
          irep_node.definitions[type] || @schema.get_field(type, irep_node.definition_name) || raise("No field found on #{type.name} for '#{irep_node.definition_name}' (#{irep_node.ast_node.name})")
        end

        def add_error(err)
          @query.context.errors << err
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
graphql-1.0.0 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.19.4 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.19.3 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.19.2 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.19.1 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.19.0 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.18.15 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.18.14 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.18.13 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.18.12 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.18.11 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.18.10 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.18.9 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.18.8 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.18.7 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.18.6 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.18.5 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.18.4 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.18.3 lib/graphql/query/serial_execution/execution_context.rb
graphql-0.18.2 lib/graphql/query/serial_execution/execution_context.rb