Class: GraphQL::BaseType
- Inherits:
-
Object
- Object
- GraphQL::BaseType
- Defined in:
- lib/graphql/relay/monkey_patches/base_type.rb
Instance Method Summary collapse
-
#connection_type ⇒ Object
Get the default connection type for this object type.
-
#define_connection(**kwargs, &block) ⇒ Object
Define a custom connection type for this object type.
-
#define_edge(**kwargs, &block) ⇒ Object
Define a custom edge type for this object type.
-
#edge_type ⇒ Object
Get the default edge type for this object type.
Instance Method Details
#connection_type ⇒ Object
Get the default connection type for this object type
3 4 5 |
# File 'lib/graphql/relay/monkey_patches/base_type.rb', line 3 def connection_type @connection_type ||= define_connection end |
#define_connection(**kwargs, &block) ⇒ Object
Define a custom connection type for this object type
8 9 10 |
# File 'lib/graphql/relay/monkey_patches/base_type.rb', line 8 def define_connection(**kwargs, &block) GraphQL::Relay::ConnectionType.create_type(self, **kwargs, &block) end |
#define_edge(**kwargs, &block) ⇒ Object
Define a custom edge type for this object type
18 19 20 |
# File 'lib/graphql/relay/monkey_patches/base_type.rb', line 18 def define_edge(**kwargs, &block) GraphQL::Relay::EdgeType.create_type(self, **kwargs, &block) end |
#edge_type ⇒ Object
Get the default edge type for this object type
13 14 15 |
# File 'lib/graphql/relay/monkey_patches/base_type.rb', line 13 def edge_type @edge_type ||= define_edge end |