class GraphQL::Introspection::TypeType

Public Instance Methods

enum_values(include_deprecated:) click to toggle source
# File lib/graphql/introspection/type_type.rb, line 44
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 84
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(include_deprecated:) click to toggle source
# File lib/graphql/introspection/type_type.rb, line 66
def input_fields(include_deprecated:)
  if @object.kind.input_object?
    args = @context.warden.arguments(@object)
    args = args.reject(&:deprecation_reason) unless include_deprecated
    args
  else
    nil
  end
end
interfaces() click to toggle source
# File lib/graphql/introspection/type_type.rb, line 58
def interfaces
  if @object.kind.object? || @object.kind.interface?
    @context.warden.interfaces(@object).sort_by(&:graphql_name)
  else
    nil
  end
end
kind() click to toggle source
# File lib/graphql/introspection/type_type.rb, line 40
def kind
  @object.kind.name
end
of_type() click to toggle source
# File lib/graphql/introspection/type_type.rb, line 96
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 76
def possible_types
  if @object.kind.abstract?
    @context.warden.possible_types(@object).sort_by(&:graphql_name)
  else
    nil
  end
end
specified_by_url() click to toggle source
# File lib/graphql/introspection/type_type.rb, line 32
def specified_by_url
  if object.kind.scalar?
    object.specified_by_url
  else
    nil
  end
end