Module: GraphQL::Types::Relay::EdgeBehaviors::ClassMethods
- Defined in:
- lib/graphql/types/relay/edge_behaviors.rb
Instance Method Summary collapse
-
#accessible?(ctx) ⇒ Boolean
-
#authorized?(obj, ctx) ⇒ Boolean
-
#node_type(node_type = nil, null: true) ⇒ Object
Get or set the Object type that this edge wraps.
-
#visible?(ctx) ⇒ Boolean
Instance Method Details
#accessible?(ctx) ⇒ Boolean
31 32 33 |
# File 'lib/graphql/types/relay/edge_behaviors.rb', line 31 def accessible?(ctx) node_type.accessible?(ctx) end |
#authorized?(obj, ctx) ⇒ Boolean
27 28 29 |
# File 'lib/graphql/types/relay/edge_behaviors.rb', line 27 def (obj, ctx) true end |
#node_type(node_type = nil, null: true) ⇒ Object
Get or set the Object type that this edge wraps.
18 19 20 21 22 23 24 25 |
# File 'lib/graphql/types/relay/edge_behaviors.rb', line 18 def node_type(node_type = nil, null: true) if node_type @node_type = node_type # Add a default `node` field field :node, node_type, null: null, description: "The item at the end of the edge.", connection: false end @node_type end |
#visible?(ctx) ⇒ Boolean
35 36 37 |
# File 'lib/graphql/types/relay/edge_behaviors.rb', line 35 def visible?(ctx) node_type.visible?(ctx) end |