Sha256: 8567182272f8d3feb06866e0b1b9ec8acd7cc1f676b2317c9a1c4a1f9c30ab66

Contents?: true

Size: 595 Bytes

Versions: 91

Compression:

Stored size: 595 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  module Dig
    # implemented using the old activesupport #dig instead of the ruby built-in
    # so we can use some of the magic in Schema::InputObject and Interpreter::Arguments
    # to handle stringified/symbolized keys.
    #
    # @param args [Array<[String, Symbol>] Retrieves the value object corresponding to the each key objects repeatedly
    # @return [Object]
    def dig(own_key, *rest_keys)
      val = self[own_key]
      if val.nil? || rest_keys.empty?
        val
      else
        val.dig(*rest_keys)
      end
    end
  end
end

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
graphql-2.1.1 lib/graphql/dig.rb
graphql-2.1.0 lib/graphql/dig.rb
graphql-2.0.27 lib/graphql/dig.rb
graphql-2.0.26 lib/graphql/dig.rb
graphql-2.0.25 lib/graphql/dig.rb
graphql-2.0.24 lib/graphql/dig.rb
graphql-2.0.23 lib/graphql/dig.rb
graphql-2.0.22 lib/graphql/dig.rb
graphql-2.0.21 lib/graphql/dig.rb
graphql-2.0.20 lib/graphql/dig.rb
graphql-2.0.17.2 lib/graphql/dig.rb
graphql-2.0.17.1 lib/graphql/dig.rb
graphql-2.0.19 lib/graphql/dig.rb
graphql-2.0.18 lib/graphql/dig.rb
graphql-2.0.17 lib/graphql/dig.rb
graphql-2.0.16 lib/graphql/dig.rb
graphql-2.0.15 lib/graphql/dig.rb
graphql-2.0.14 lib/graphql/dig.rb
graphql-2.0.13 lib/graphql/dig.rb
graphql-2.0.12 lib/graphql/dig.rb