You are here

public function PersistedQueryPluginThree::getQuery in GraphQL 8.4

Returns a query if this plugin has it.

Parameters

string $id: ID of the persisted query.

\GraphQL\Server\OperationParams $operation: The operation with parameters.

Return value

string|null The actual GraphQL query, or NULL if this plugin does not support a query with that ID.

Overrides PersistedQueryPluginInterface::getQuery

File

tests/modules/graphql_persisted_queries_test/src/Plugin/GraphQL/PersistedQuery/PersistedQueryPluginThree.php, line 23

Class

PersistedQueryPluginThree
@PersistedQuery( id = "persisted_query_plugin_three", label = "Persisted Query Three", description = "This is the third persisted query plugin" )

Namespace

Drupal\graphql_persisted_queries_test\Plugin\GraphQL\PersistedQuery

Code

public function getQuery($id, OperationParams $operation) {
  $queryMap = $this
    ->queryMap();
  return $queryMap[$id] ?? NULL;
}