Class: PlatformosCheck::InvalidArgs::ParsedGraphQL

Inherits:
Object
  • Object
show all
Defined in:
lib/platformos_check/checks/invalid_args.rb

Instance Method Summary collapse

Constructor Details

#initialize(ast) ⇒ ParsedGraphQL

Returns a new instance of ParsedGraphQL.



6
7
8
# File 'lib/platformos_check/checks/invalid_args.rb', line 6

def initialize(ast)
  @ast = ast
end

Instance Method Details

#defined_argumentsObject



16
17
18
# File 'lib/platformos_check/checks/invalid_args.rb', line 16

def defined_arguments
  variables.map(&:name)
end

#required_argumentsObject



10
11
12
13
14
# File 'lib/platformos_check/checks/invalid_args.rb', line 10

def required_arguments
  variables.each_with_object([]) do |v, vars|
    vars << v.name if v.type.is_a?(GraphQL::Language::Nodes::NonNullType)
  end
end