module GraphQL::Client::DefinitionVariables

def self.variable_node(type)

Returns GraphQL::Language::Nodes::Type.

type - A GraphQL::Type

Internal: Get AST node for GraphQL type.
def self.variable_node(type)
  case type.kind.name
  when "NON_NULL"
    GraphQL::Language::Nodes::NonNullType.new(of_type: variable_node(type.of_type))
  when "LIST"
    GraphQL::Language::Nodes::ListType.new(of_type: variable_node(type.of_type))
  else
    GraphQL::Language::Nodes::TypeName.new(name: type.graphql_name)
  end
end