Sha256: 99970e7bd55947a32842796fa26e2fe2770f1206c5794cba8251ff18b0f623df

Contents?: true

Size: 1.01 KB

Versions: 9

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

module GraphQL
  module Execution
    class Interpreter
      # A wrapper for argument hashes in GraphQL queries.
      #
      # @see GraphQL::Query#arguments_for to get access to these objects.
      class Arguments
        extend Forwardable
        include GraphQL::Dig

        # The Ruby-style arguments hash, ready for a resolver.
        # This hash is the one used at runtime.
        #
        # @return [Hash<Symbol, Object>]
        attr_reader :keyword_arguments

        def initialize(keyword_arguments:, argument_values:)
          @keyword_arguments = keyword_arguments
          @argument_values = argument_values
        end

        # @return [Hash{Symbol => ArgumentValue}]
        attr_reader :argument_values

        def_delegators :@keyword_arguments, :key?, :[], :keys, :each, :values
        def_delegators :@argument_values, :each_value

        def inspect
          "#<#{self.class} @keyword_arguments=#{keyword_arguments.inspect}>"
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
graphql-1.11.4 lib/graphql/execution/interpreter/arguments.rb
graphql-1.11.3 lib/graphql/execution/interpreter/arguments.rb
graphql-1.11.2 lib/graphql/execution/interpreter/arguments.rb
graphql-1.10.14 lib/graphql/execution/interpreter/arguments.rb
graphql-1.11.1 lib/graphql/execution/interpreter/arguments.rb
graphql-1.10.13 lib/graphql/execution/interpreter/arguments.rb
graphql-1.11.0 lib/graphql/execution/interpreter/arguments.rb
graphql-1.10.12 lib/graphql/execution/interpreter/arguments.rb
graphql-1.10.11 lib/graphql/execution/interpreter/arguments.rb