Method: GraphQL::Types::Relay::EdgeBehaviors::ClassMethods#node_type
- Defined in:
- lib/graphql/types/relay/edge_behaviors.rb
#node_type(node_type = nil, null: self.node_nullable, field_options: nil) ⇒ Object
Get or set the Object type that this edge wraps.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/graphql/types/relay/edge_behaviors.rb', line 48 def node_type(node_type = nil, null: self.node_nullable, field_options: nil) if node_type @node_type = node_type # Add a default `node` field = { name: :node, type: node_type, null: null, description: "The item at the end of the edge.", connection: false, } if .merge!() end field(**) end @node_type end |