You are here

class EdgeNode in Open Social 10.0.x

Same name and namespace in other branches
  1. 10.3.x modules/custom/social_graphql/src/Plugin/GraphQL/DataProducer/Edge/EdgeNode.php \Drupal\social_graphql\Plugin\GraphQL\DataProducer\Edge\EdgeNode
  2. 10.1.x modules/custom/social_graphql/src/Plugin/GraphQL/DataProducer/Edge/EdgeNode.php \Drupal\social_graphql\Plugin\GraphQL\DataProducer\Edge\EdgeNode
  3. 10.2.x modules/custom/social_graphql/src/Plugin/GraphQL/DataProducer/Edge/EdgeNode.php \Drupal\social_graphql\Plugin\GraphQL\DataProducer\Edge\EdgeNode

Returns the node for an edge.

Plugin annotation


@DataProducer(
  id = "edge_node",
  name = @Translation("Edge node"),
  description = @Translation("Returns the node associated with an edge."),
  produces = @ContextDefinition("any",
    label = @Translation("Node")
  ),
  consumes = {
    "edge" = @ContextDefinition("any",
      label = @Translation("EdgeInterface")
    )
  }
)

Hierarchy

  • class \Drupal\social_graphql\Plugin\GraphQL\DataProducer\Edge\EdgeNode extends \Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase implements \Drupal\graphql\Plugin\DataProducerPluginCachingInterface

Expanded class hierarchy of EdgeNode

File

modules/custom/social_graphql/src/Plugin/GraphQL/DataProducer/Edge/EdgeNode.php, line 26

Namespace

Drupal\social_graphql\Plugin\GraphQL\DataProducer\Edge
View source
class EdgeNode extends DataProducerPluginBase implements DataProducerPluginCachingInterface {

  /**
   * Resolves the value.
   *
   * @param \Drupal\social_graphql\Wrappers\EdgeInterface $edge
   *   The edge to retrieve the node from.
   *
   * @return mixed
   *   The graph node.
   */
  public function resolve(EdgeInterface $edge) {
    return $edge
      ->getNode();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EdgeNode::resolve public function Resolves the value.