Module: GraphQL::Relay::TypeExtensions
- Included in:
 - BaseType, Schema::Interface::DefinitionMethods, Schema::Member
 
- Defined in:
 - lib/graphql/relay/type_extensions.rb
 
Overview
Mixin for Relay-related methods in type objects (used by BaseType and Schema::Member).
Instance Method Summary collapse
- 
  
    
      #connection_type  ⇒ GraphQL::ObjectType 
    
    
  
  
  
  
  
  
  
  
  
    
The default connection type for this object type.
 - 
  
    
      #define_connection(**kwargs, &block)  ⇒ GraphQL::ObjectType 
    
    
  
  
  
  
  
  
  
  
  
    
Define a custom connection type for this object type.
 - 
  
    
      #define_edge(**kwargs, &block)  ⇒ GraphQL::ObjectType 
    
    
  
  
  
  
  
  
  
  
  
    
Define a custom edge type for this object type.
 - 
  
    
      #edge_type  ⇒ GraphQL::ObjectType 
    
    
  
  
  
  
  
  
  
  
  
    
The default edge type for this object type.
 
Instance Method Details
#connection_type ⇒ GraphQL::ObjectType
Returns The default connection type for this object type
      8 9 10  | 
    
      # File 'lib/graphql/relay/type_extensions.rb', line 8 def connection_type @connection_type ||= define_connection end  | 
  
#define_connection(**kwargs, &block) ⇒ GraphQL::ObjectType
Define a custom connection type for this object type
      14 15 16  | 
    
      # File 'lib/graphql/relay/type_extensions.rb', line 14 def define_connection(**kwargs, &block) GraphQL::Relay::ConnectionType.create_type(self, **kwargs, &block) end  | 
  
#define_edge(**kwargs, &block) ⇒ GraphQL::ObjectType
Define a custom edge type for this object type
      25 26 27  | 
    
      # File 'lib/graphql/relay/type_extensions.rb', line 25 def define_edge(**kwargs, &block) GraphQL::Relay::EdgeType.create_type(self, **kwargs, &block) end  | 
  
#edge_type ⇒ GraphQL::ObjectType
Returns The default edge type for this object type
      19 20 21  | 
    
      # File 'lib/graphql/relay/type_extensions.rb', line 19 def edge_type @edge_type ||= define_edge end  |