Sha256: 9043e9c4aaea2d238d0344ee4be215ad8e405ea63317899edb3981a2dcd08bd1

Contents?: true

Size: 898 Bytes

Versions: 26

Compression:

Stored size: 898 Bytes

Contents

# frozen_string_literal: true
module GraphQL
  class Query
    module ArgumentsCache
      # @return [Hash<InternalRepresentation::Node, GraphQL::Language::NodesDirectiveNode => Hash<GraphQL::Field, GraphQL::Directive => GraphQL::Query::Arguments>>]
      def self.build(query)
        Hash.new do |h1, irep_or_ast_node|
          h1[irep_or_ast_node] = Hash.new do |h2, definition|
            ast_node = irep_or_ast_node.is_a?(GraphQL::InternalRepresentation::Node) ? irep_or_ast_node.ast_node : irep_or_ast_node
            h2[definition] = if definition.arguments(query.context).empty?
              GraphQL::Query::Arguments::NO_ARGS
            else
              GraphQL::Query::LiteralInput.from_arguments(
                ast_node.arguments,
                definition,
                query.variables,
              )
            end
          end
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
graphql-1.13.24 lib/graphql/query/arguments_cache.rb
graphql-1.13.23 lib/graphql/query/arguments_cache.rb
graphql-1.13.22 lib/graphql/query/arguments_cache.rb
graphql-1.13.21 lib/graphql/query/arguments_cache.rb
graphql-1.13.20 lib/graphql/query/arguments_cache.rb
graphql-1.13.19 lib/graphql/query/arguments_cache.rb
graphql-1.13.18 lib/graphql/query/arguments_cache.rb
graphql-1.13.17 lib/graphql/query/arguments_cache.rb
graphql-1.13.16 lib/graphql/query/arguments_cache.rb
graphql-1.13.15 lib/graphql/query/arguments_cache.rb
graphql-1.13.14 lib/graphql/query/arguments_cache.rb
graphql-1.13.13 lib/graphql/query/arguments_cache.rb
graphql_cody-1.13.0 lib/graphql/query/arguments_cache.rb
graphql-1.13.12 lib/graphql/query/arguments_cache.rb
graphql-1.13.11 lib/graphql/query/arguments_cache.rb
graphql-1.13.10 lib/graphql/query/arguments_cache.rb
graphql-1.13.9 lib/graphql/query/arguments_cache.rb
graphql-1.13.8 lib/graphql/query/arguments_cache.rb
graphql-1.13.7 lib/graphql/query/arguments_cache.rb
graphql-1.13.6 lib/graphql/query/arguments_cache.rb