class GraphQL::Introspection::TypeType

Public Instance Methods

enum_values(include_deprecated:) click to toggle source
# File lib/graphql/introspection/type_type.rb, line 31
def enum_values(include_deprecated))
  if !@object.kind.enum?
    nil
  else
    enum_values = @context.warden.enum_values(@object)

    if !include_deprecated
      enum_values = enum_values.select {|f| !f.deprecation_reason }
    end

    enum_values
  end
end
fields(include_deprecated:) click to toggle source
# File lib/graphql/introspection/type_type.rb, line 69
def fields(include_deprecated))
  if !@object.kind.fields?
    nil
  else
    fields = @context.warden.fields(@object)
    if !include_deprecated
      fields = fields.select {|f| !f.deprecation_reason }
    end
    fields.sort_by(&:name)
  end
end
input_fields() click to toggle source
# File lib/graphql/introspection/type_type.rb, line 53
def input_fields
  if @object.kind.input_object?
    @context.warden.arguments(@object)
  else
    nil
  end
end
interfaces() click to toggle source
# File lib/graphql/introspection/type_type.rb, line 45
def interfaces
  if @object.kind == GraphQL::TypeKinds::OBJECT
    @context.warden.interfaces(@object)
  else
    nil
  end
end
kind() click to toggle source
# File lib/graphql/introspection/type_type.rb, line 27
def kind
  @object.kind.name
end
of_type() click to toggle source
# File lib/graphql/introspection/type_type.rb, line 81
def of_type
  @object.kind.wraps? ? @object.of_type : nil
end
possible_types() click to toggle source
# File lib/graphql/introspection/type_type.rb, line 61
def possible_types
  if @object.kind.resolves?
    @context.warden.possible_types(@object)
  else
    nil
  end
end