Sha256: ba84cb18344376d63890af5077e27fb1d6224bfe391b88f0201c2dc623471370

Contents?: true

Size: 906 Bytes

Versions: 47

Compression:

Stored size: 906 Bytes

Contents

# frozen_string_literal: true
# test_via: ../query.rb
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.none?
              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

47 entries across 47 versions & 1 rubygems

Version Path
graphql-1.8.18 lib/graphql/query/arguments_cache.rb
graphql-1.8.17 lib/graphql/query/arguments_cache.rb
graphql-1.8.16 lib/graphql/query/arguments_cache.rb
graphql-1.8.15 lib/graphql/query/arguments_cache.rb
graphql-1.8.14 lib/graphql/query/arguments_cache.rb
graphql-1.9.0.pre3 lib/graphql/query/arguments_cache.rb
graphql-1.9.0.pre2 lib/graphql/query/arguments_cache.rb
graphql-1.8.13 lib/graphql/query/arguments_cache.rb
graphql-1.8.12 lib/graphql/query/arguments_cache.rb
graphql-1.9.0.pre1 lib/graphql/query/arguments_cache.rb
graphql-1.8.11 lib/graphql/query/arguments_cache.rb
graphql-1.8.10 lib/graphql/query/arguments_cache.rb
graphql-1.8.9 lib/graphql/query/arguments_cache.rb
graphql-1.8.8 lib/graphql/query/arguments_cache.rb
graphql-1.8.7 lib/graphql/query/arguments_cache.rb
graphql-1.8.6 lib/graphql/query/arguments_cache.rb
graphql-1.8.5 lib/graphql/query/arguments_cache.rb
graphql-1.8.4 lib/graphql/query/arguments_cache.rb
graphql-1.8.3 lib/graphql/query/arguments_cache.rb
graphql-1.8.2 lib/graphql/query/arguments_cache.rb