storeManager = $storeManager; } /** * Handle the value of the store and set the scope * * {@inheritDoc} * @throws NoSuchEntityException */ public function processHeaderValue(string $headerValue) : void { if ($headerValue) { $storeCode = ltrim(rtrim($headerValue)); $stores = $this->storeManager->getStores(false, true); if (isset($stores[$storeCode])) { $this->storeManager->setCurrentStore($storeCode); } elseif (strtolower($storeCode) !== 'default') { throw new GraphQlInputException( new \Magento\Framework\Phrase('Store code %1 does not exist', [$storeCode]) ); } } } }