class GraphQL::Introspection::TypeType
Public Class Methods
# File lib/graphql/introspection/type_type.rb, line 64 def self.resolve_enum_values(object, context, include_deprecated:) if !object.kind.enum? nil else enum_values = context.types.enum_values(object) if !include_deprecated enum_values = enum_values.select {|f| !f.deprecation_reason } end enum_values end end
# File lib/graphql/introspection/type_type.rb, line 120 def self.resolve_fields(object, context, include_deprecated:) if !object.kind.fields? nil else fields = context.types.fields(object) if !include_deprecated fields = fields.select {|f| !f.deprecation_reason } end fields.sort_by(&:name) end end
# File lib/graphql/introspection/type_type.rb, line 94 def self.resolve_input_fields(object, context, include_deprecated:) if object.kind.input_object? args = context.types.arguments(object) args = args.reject(&:deprecation_reason) unless include_deprecated args else nil end end
# File lib/graphql/introspection/type_type.rb, line 82 def self.resolve_interfaces(object, context) if object.kind.object? || object.kind.interface? context.types.interfaces(object).sort_by(&:graphql_name) else nil end end
# File lib/graphql/introspection/type_type.rb, line 35 def self.resolve_is_one_of(object, _ctx) object.kind.input_object? && object.directives.any? { |d| d.graphql_name == "oneOf" } end
# File lib/graphql/introspection/type_type.rb, line 56 def self.resolve_kind(object, context) object.kind.name end
# File lib/graphql/introspection/type_type.rb, line 136 def self.resolve_of_type(object, _ctx) object.kind.wraps? ? object.of_type : nil end
# File lib/graphql/introspection/type_type.rb, line 108 def self.resolve_possible_types(object, context) if object.kind.abstract? context.types.possible_types(object).sort_by(&:graphql_name) else nil end end
# File lib/graphql/introspection/type_type.rb, line 44 def self.resolve_specified_by_url(object, _ctx) if object.kind.scalar? object.specified_by_url else nil end end
Public Instance Methods
# File lib/graphql/introspection/type_type.rb, line 78 def enum_values(include_deprecated:) self.class.resolve_enum_values(object, context, include_deprecated: include_deprecated) end
Source
# File lib/graphql/introspection/type_type.rb, line 132 def fields(include_deprecated:) self.class.resolve_fields(object, context, include_deprecated: include_deprecated) end
# File lib/graphql/introspection/type_type.rb, line 104 def input_fields(include_deprecated:) self.class.resolve_input_fields(object, context, include_deprecated: include_deprecated) end
Source
# File lib/graphql/introspection/type_type.rb, line 90 def interfaces self.class.resolve_interfaces(object, context) end
Source
# File lib/graphql/introspection/type_type.rb, line 40 def is_one_of self.class.resolve_is_one_of(object, context) end
Source
# File lib/graphql/introspection/type_type.rb, line 60 def kind self.class.resolve_kind(object, context) end
Source
# File lib/graphql/introspection/type_type.rb, line 140 def of_type self.class.resolve_of_type(object, context) end
Source
# File lib/graphql/introspection/type_type.rb, line 116 def possible_types self.class.resolve_possible_types(object, context) end
Source
# File lib/graphql/introspection/type_type.rb, line 52 def specified_by_url self.class.resolve_specified_by_url(object, context) end