You are here

class EdgeCursor in Open Social 10.3.x

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

Returns the cursor for an edge.

Plugin annotation


@DataProducer(
  id = "edge_cursor",
  name = @Translation("Edge cursor"),
  description = @Translation("Returns the cursor of an edge."),
  produces = @ContextDefinition("string",
    label = @Translation("Cursor")
  ),
  consumes = {
    "edge" = @ContextDefinition("any",
      label = @Translation("EdgeInterface")
    )
  }
)

Hierarchy

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

Expanded class hierarchy of EdgeCursor

File

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

Namespace

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

  /**
   * Resolves the value for this data producer.
   *
   * @param \Drupal\social_graphql\Wrappers\EdgeInterface $edge
   *   The edge to return the cursor for.
   *
   * @return mixed
   *   The cursor for this edge.
   */
  public function resolve(EdgeInterface $edge) {
    return $edge
      ->getCursor();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EdgeCursor::resolve public function Resolves the value for this data producer.