public function SubrequestSubscriber::onKernelRequest in GraphQL 8.4
Same name and namespace in other branches
- 8.3 src/EventSubscriber/SubrequestSubscriber.php \Drupal\graphql\EventSubscriber\SubrequestSubscriber::onKernelRequest()
Handle kernel request events.
Parameters
\Symfony\Component\HttpKernel\Event\GetResponseEvent $event: The kernel event object.
File
- src/
EventSubscriber/ SubrequestSubscriber.php, line 42
Class
- SubrequestSubscriber
- Sets the language on subrequests.
Namespace
Drupal\graphql\EventSubscriberCode
public function onKernelRequest(GetResponseEvent $event) : void {
$request = $event
->getRequest();
if (!$request->attributes
->has('_graphql_subrequest')) {
return;
}
$request->attributes
->set('_controller', '\\Drupal\\graphql\\Controller\\SubrequestExtractionController:extract');
$this
->resetLanguageContext();
}