You are here

interface ConnectionInterface in Open Social 10.0.x

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

Provides the interface for connections.

Hierarchy

Expanded class hierarchy of ConnectionInterface

All classes that implement ConnectionInterface

1 file declares its use of ConnectionInterface
ConnectionNodes.php in modules/custom/social_graphql/src/Plugin/GraphQL/DataProducer/Connection/ConnectionNodes.php

File

modules/custom/social_graphql/src/GraphQL/ConnectionInterface.php, line 10

Namespace

Drupal\social_graphql\GraphQL
View source
interface ConnectionInterface {

  /**
   * Specifies the pagination parameters for this query.
   *
   * This can only be called before results have been fetched.
   *
   * @param int|null $first
   *   The limit of N first results (either first XOR last must be set).
   * @param string|null $after
   *   The cursor after which to fetch results (when using `$first`).
   * @param int|null $last
   *   The limit of N last results (either first XOR last must be set).
   * @param string|null $before
   *   The cursor before which to fetch results (when using `$last`).
   * @param bool $reverse
   *   Whether the sorting is in reversed order.
   *
   * @return $this
   *   This connection instance.
   */
  public function setPagination(?int $first, ?string $after, ?int $last, ?string $before, bool $reverse) : self;

  /**
   * Get the page info from the connection.
   *
   * @return \GraphQL\Executor\Promise\Adapter\SyncPromise
   *   An promise that resolves to an array containing the fields of page info.
   */
  public function pageInfo() : SyncPromise;

  /**
   * Get the edges from the connection.
   *
   * @return \GraphQL\Executor\Promise\Adapter\SyncPromise
   *   A promise that resolves to an array of EntityEdge instances.
   */
  public function edges() : SyncPromise;

  /**
   * Get hte nodes for this connection.
   *
   * This allows bypassing of the edges in case edge information isn't needed.
   *
   * @return \GraphQL\Executor\Promise\Adapter\SyncPromise
   *   A promise that resolves to an array of entities.
   */
  public function nodes() : SyncPromise;

}

Members

Namesort descending Modifiers Type Description Overrides
ConnectionInterface::edges public function Get the edges from the connection.
ConnectionInterface::nodes public function Get hte nodes for this connection.
ConnectionInterface::pageInfo public function Get the page info from the connection.
ConnectionInterface::setPagination public function Specifies the pagination parameters for this query.