class GraphQL::Introspection::TypeType

Public Instance Methods

enum_values(include_deprecated:) click to toggle source
# File lib/graphql/introspection/type_type.rb, line 32
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 70
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 54
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 46
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 28
def kind
  @object.kind.name
end
of_type() click to toggle source
# File lib/graphql/introspection/type_type.rb, line 82
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 62
def possible_types
  if @object.kind.abstract?
    @context.warden.possible_types(@object)
  else
    nil
  end
end