Skip to content
Snippets Groups Projects
Commit e3d01957 authored by Dalibor Matura's avatar Dalibor Matura Committed by Eli Stone
Browse files

Issue #3091304 by dabbor: Alter graphql data just before templates are rendered

parent e514f1e5
No related branches found
No related tags found
No related merge requests found
......@@ -121,7 +121,12 @@ trait GraphQLTemplateTrait {
print('</ul>');
}
else {
// Allow graphql data alteration.
/** @var \Drupal\Core\Theme\ThemeManager $themeManager */
$themeManager = \Drupal::service('theme.manager');
$themeManager->alter('graphql_twig_data', $queryResult->data, $context);
$context['graphql'] = $queryResult->data;
if ($this->env->isDebug() && $debug_placement == 'inside') {
$context['graphql_debug'] = [
'#markup' => sprintf(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment