PayloadClientMutationId.php in Open Social 10.1.x
Same filename and directory in other branches
- 10.3.x modules/custom/social_graphql/src/Plugin/GraphQL/DataProducer/Payload/PayloadClientMutationId.php
- 10.0.x modules/custom/social_graphql/src/Plugin/GraphQL/DataProducer/Payload/PayloadClientMutationId.php
- 10.2.x modules/custom/social_graphql/src/Plugin/GraphQL/DataProducer/Payload/PayloadClientMutationId.php
File
modules/custom/social_graphql/src/Plugin/GraphQL/DataProducer/Payload/PayloadClientMutationId.phpView source
<?php
namespace Drupal\social_graphql\Plugin\GraphQL\DataProducer\Payload;
use Drupal\graphql\Plugin\DataProducerPluginCachingInterface;
use Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginBase;
use Drupal\social_graphql\GraphQL\Payload\RelayMutationPayloadInterface;
/**
* Returns the client mutation id in a payload.
*
* @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")
* )
* }
* )
*/
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();
}
}
Classes
Name | Description |
---|---|
PayloadClientMutationId | Returns the client mutation id in a payload. |