class GraphQLSchema::TypeDeclaration

Public Instance Methods

list?() click to toggle source
# File lib/graphql_schema.rb, line 191
def list?
  kind == 'LIST'
end
non_null?() click to toggle source
# File lib/graphql_schema.rb, line 195
def non_null?
  kind == 'NON_NULL'
end
of_type() click to toggle source
# File lib/graphql_schema.rb, line 187
def of_type
  @of_type ||= TypeDeclaration.new(@hash.fetch('ofType'))
end
subfields?() click to toggle source
# File lib/graphql_schema.rb, line 216
def subfields?
  case unwrap.kind
  when 'OBJECT', 'INTERFACE', 'UNION'
    true
  else
    false
  end
end
unwrap() click to toggle source
# File lib/graphql_schema.rb, line 199
def unwrap
  case kind
  when 'NON_NULL', 'LIST'
    of_type.unwrap
  else
    self
  end
end
unwrap_list() click to toggle source
# File lib/graphql_schema.rb, line 208
def unwrap_list
  list? ? of_type.unwrap_list : self
end
unwrap_non_null() click to toggle source
# File lib/graphql_schema.rb, line 212
def unwrap_non_null
  non_null? ? of_type.unwrap_non_null : self
end