class GraphQL::Introspection::TypeType
Public Class Methods
# File lib/graphql/introspection/type_type.rb, line 65 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 121 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 95 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 83 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 36 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 57 def self.resolve_kind(object, context) object.kind.name end
# File lib/graphql/introspection/type_type.rb, line 137 def self.resolve_of_type(object, _ctx) object.kind.wraps? ? object.of_type : nil end
# File lib/graphql/introspection/type_type.rb, line 109 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 45 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 79 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 133 def fields(include_deprecated:) self.class.resolve_fields(object, context, include_deprecated: include_deprecated) end
# File lib/graphql/introspection/type_type.rb, line 105 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 91 def interfaces self.class.resolve_interfaces(object, context) end
Source
# File lib/graphql/introspection/type_type.rb, line 41 def is_one_of self.class.resolve_is_one_of(object, context) end
Source
# File lib/graphql/introspection/type_type.rb, line 61 def kind self.class.resolve_kind(object, context) end
Source
# File lib/graphql/introspection/type_type.rb, line 141 def of_type self.class.resolve_of_type(object, context) end
Source
# File lib/graphql/introspection/type_type.rb, line 117 def possible_types self.class.resolve_possible_types(object, context) end
Source
# File lib/graphql/introspection/type_type.rb, line 53 def specified_by_url self.class.resolve_specified_by_url(object, context) end