PersistedQueryPluginTwo.php in GraphQL 8.4
File
tests/modules/graphql_persisted_queries_test/src/Plugin/GraphQL/PersistedQuery/PersistedQueryPluginTwo.php
View source
<?php
namespace Drupal\graphql_persisted_queries_test\Plugin\GraphQL\PersistedQuery;
use Drupal\graphql\PersistedQuery\PersistedQueryPluginBase;
use GraphQL\Server\OperationParams;
class PersistedQueryPluginTwo extends PersistedQueryPluginBase {
public function getQuery($id, OperationParams $operation) {
$queryMap = $this
->queryMap();
return $queryMap[$id] ?? NULL;
}
protected function queryMap() : array {
return [
'query_1' => 'query { field_two }',
];
}
}
Classes
Name |
Description |
PersistedQueryPluginTwo |
@PersistedQuery(
id = "persisted_query_plugin_two",
label = "Persisted Query Two",
description = "This is the second persisted query plugin"
) |