You are here

class ConnectionPageInfo in Open Social 10.1.x

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

Produces the page info from a connection object.

Plugin annotation


@DataProducer(
  id = "connection_page_info",
  name = @Translation("Connection page info"),
  description = @Translation("Returns the page info of a connection."),
  produces = @ContextDefinition("page_info",
    label = @Translation("Page Info")
  ),
  consumes = {
    "connection" = @ContextDefinition("any",
      label = @Translation("QueryConnection")
    )
  }
)

Hierarchy

  • class \Drupal\social_graphql\Plugin\GraphQL\DataProducer\Connection\ConnectionPageInfo extends \Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase implements \Drupal\graphql\Plugin\DataProducerPluginCachingInterface

Expanded class hierarchy of ConnectionPageInfo

File

modules/custom/social_graphql/src/Plugin/GraphQL/DataProducer/Connection/ConnectionPageInfo.php, line 26

Namespace

Drupal\social_graphql\Plugin\GraphQL\DataProducer\Connection
View source
class ConnectionPageInfo extends DataProducerPluginBase implements DataProducerPluginCachingInterface {

  /**
   * Resolves the request.
   *
   * @param \Drupal\social_graphql\GraphQL\EntityConnection $connection
   *   The connection to return the page info for.
   *
   * @return mixed
   *   The page info for the connection.
   */
  public function resolve(EntityConnection $connection) {
    return $connection
      ->pageInfo();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ConnectionPageInfo::resolve public function Resolves the request.