Overview
Object types represent a list of named fields, each of which yield a value of a specific type. Objects are the most common output type in GraphQL schemas. Inherits from:Rails::GraphQL::Type
Specification: GraphQL Object Type Definition
Class Attributes
The type of field class used for this type’s fields
Valid field types that can be used in object fields:
Type::EnumType::InterfaceType::ObjectType::ScalarType::Union
Class Methods
implements(*others, import_fields: true)
Assign one or more interfaces to the object type.
One or more interface types to implement
Whether to automatically import fields from the interface
implements?(interface)
Check if the object implements a given interface.
The interface to check
Returns
true if the object implements the interfacevalid_member?(value)
Check if a given value is a valid member of this object type.
The value to validate
Returns
true if the value is valid for this object type=~(other)
Check if another type is equivalent to this object.
The type to compare
Returns
true if the other type is equivalent or is an interface this object implementsIncluded Modules
Helpers::Instantiable
Provides instance creation capabilities
Helpers::WithAssignment
Allows assignment to Ruby classes via
assigned_toHelpers::WithFields
Provides field definition and management methods
Configuration
Special Features
Interface Implementation
When implementing an interface withimport_fields: true, all interface fields are automatically copied to the object. Pre-existing fields with the same name must be equivalent.