Sha256: 0b2db23804843c7db044df0395c3819d511a3c3249bf9c854001e183e7d4c671

Contents?: true

Size: 907 Bytes

Versions: 59

Compression:

Stored size: 907 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.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

59 entries across 59 versions & 1 rubygems

Version Path
graphql-1.11.12 lib/graphql/query/arguments_cache.rb
graphql-1.11.11 lib/graphql/query/arguments_cache.rb
graphql-1.11.10 lib/graphql/query/arguments_cache.rb
graphql-1.11.9 lib/graphql/query/arguments_cache.rb
graphql-1.11.8 lib/graphql/query/arguments_cache.rb
graphql-1.12.3 lib/graphql/query/arguments_cache.rb
graphql-1.12.2 lib/graphql/query/arguments_cache.rb
graphql-1.12.1 lib/graphql/query/arguments_cache.rb
graphql-1.12.0 lib/graphql/query/arguments_cache.rb
graphql-1.11.7 lib/graphql/query/arguments_cache.rb
graphql-1.11.6 lib/graphql/query/arguments_cache.rb
graphql-1.11.5 lib/graphql/query/arguments_cache.rb
graphql-1.11.4 lib/graphql/query/arguments_cache.rb
graphql-1.11.3 lib/graphql/query/arguments_cache.rb
graphql-1.11.2 lib/graphql/query/arguments_cache.rb
graphql-1.10.14 lib/graphql/query/arguments_cache.rb
graphql-1.11.1 lib/graphql/query/arguments_cache.rb
graphql-1.10.13 lib/graphql/query/arguments_cache.rb
graphql-1.11.0 lib/graphql/query/arguments_cache.rb
graphql-1.10.12 lib/graphql/query/arguments_cache.rb