Sha256: dbbb711e06bcf8a6b85c2a29e0257d815d109e482bddfc5bf39d81d093761291

Contents?: true

Size: 589 Bytes

Versions: 112

Compression:

Stored size: 589 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 Query::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

112 entries across 112 versions & 2 rubygems

Version Path
graphql-1.13.5 lib/graphql/dig.rb
graphql-1.13.4 lib/graphql/dig.rb
graphql-1.13.3 lib/graphql/dig.rb
graphql-1.12.23 lib/graphql/dig.rb
graphql-1.13.2 lib/graphql/dig.rb
graphql-1.13.1 lib/graphql/dig.rb
graphql-1.12.22 lib/graphql/dig.rb
graphql-1.13.0 lib/graphql/dig.rb
graphql-1.12.21 lib/graphql/dig.rb
graphql-1.12.20 lib/graphql/dig.rb
graphql-1.12.19 lib/graphql/dig.rb
graphql-1.11.10 lib/graphql/dig.rb
graphql-1.12.18 lib/graphql/dig.rb
graphql-1.11.9 lib/graphql/dig.rb
graphql-1.12.17 lib/graphql/dig.rb
graphql-1.12.16 lib/graphql/dig.rb
graphql-1.12.15 lib/graphql/dig.rb
graphql-1.12.14 lib/graphql/dig.rb
graphql-1.12.13 lib/graphql/dig.rb
graphql-1.12.12 lib/graphql/dig.rb