public function PersistedQueryPluginTwo::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/ PersistedQueryPluginTwo.php, line 23
Class
- PersistedQueryPluginTwo
- @PersistedQuery( id = "persisted_query_plugin_two", label = "Persisted Query Two", description = "This is the second persisted query plugin" )
Namespace
Drupal\graphql_persisted_queries_test\Plugin\GraphQL\PersistedQueryCode
public function getQuery($id, OperationParams $operation) {
$queryMap = $this
->queryMap();
return $queryMap[$id] ?? NULL;
}