You are here

class PayloadClientMutationId 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/Payload/PayloadClientMutationId.php \Drupal\social_graphql\Plugin\GraphQL\DataProducer\Payload\PayloadClientMutationId
  2. 10.0.x modules/custom/social_graphql/src/Plugin/GraphQL/DataProducer/Payload/PayloadClientMutationId.php \Drupal\social_graphql\Plugin\GraphQL\DataProducer\Payload\PayloadClientMutationId
  3. 10.2.x modules/custom/social_graphql/src/Plugin/GraphQL/DataProducer/Payload/PayloadClientMutationId.php \Drupal\social_graphql\Plugin\GraphQL\DataProducer\Payload\PayloadClientMutationId

Returns the client mutation id in a payload.

Plugin annotation


@DataProducer(
  id = "payload_client_mutation_id",
  name = @Translation("Payload client mutation id"),
  description = @Translation("Returns the client mutation id from a payload."),
  produces = @ContextDefinition("any",
    label = @Translation("Client Mutation ID")
  ),
  consumes = {
    "payload" = @ContextDefinition("any",
      label = @Translation("Payload")
    )
  }
)

Hierarchy

  • class \Drupal\social_graphql\Plugin\GraphQL\DataProducer\Payload\PayloadClientMutationId extends \Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase implements \Drupal\graphql\Plugin\DataProducerPluginCachingInterface

Expanded class hierarchy of PayloadClientMutationId

File

modules/custom/social_graphql/src/Plugin/GraphQL/DataProducer/Payload/PayloadClientMutationId.php, line 26

Namespace

Drupal\social_graphql\Plugin\GraphQL\DataProducer\Payload
View source
class PayloadClientMutationId extends DataProducerPluginBase implements DataProducerPluginCachingInterface {

  /**
   * Resolves the value for this data producer.
   *
   * @param \Drupal\social_graphql\GraphQL\Payload\RelayMutationPayloadInterface $payload
   *   The payload to return the client mutation id for.
   *
   * @return null|string
   *   The client mutation identifier.
   */
  public function resolve(RelayMutationPayloadInterface $payload) {
    return $payload
      ->getClientMutationId();
  }

}

Members

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