Method: GraphQL::Execution::Lookahead#arguments

Defined in:
lib/graphql/execution/lookahead.rb

#argumentsHash<Symbol, Object>

Returns:

  • (Hash<Symbol, Object>)


53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/graphql/execution/lookahead.rb', line 53

def arguments
  if defined?(@arguments)
    @arguments
  else
    @arguments = if @field
      @query.after_lazy(@query.arguments_for(@ast_nodes.first, @field)) do |args|
        case args
        when Execution::Interpreter::Arguments
          args.keyword_arguments
        when GraphQL::ExecutionError
          EmptyObjects::EMPTY_HASH
        else
          args
        end
      end
    else
      nil
    end
  end
end