The store is composed of different websites with multiple stores and multiple storeviews.

I'm developing a functionality to get the particular storeview depending on the location of the customer and get its product catalog with prices.

But when I go to get the information from the current store I am always in the default store using GraphQL query,

  • How could I get the information from any other store or set values in a different store?

  • Is there a GraphQl query or can I make a request to the Rest API to change store to get the products from a store using the store id or store code?

4 Answers 4


GraphQL request accepts the Store into headers.

Header Key : Store

Header Value : <store_view_code>

The store view code on which to perform the request. The value can be default or the code that is defined when a store view is created.

enter image description here

I recommend you to use Altair GraphQL Client

For More Header click Here

I Hope This Helps You.

  • Not sure why they can't do this in the code, 2.4.4 still has this problem
    – David Tay
    Commented Aug 31, 2022 at 16:37
  • @DavidTay If you need it so please rise issue in Magento github.
    – Msquare
    Commented Aug 31, 2022 at 17:31

For Storewise Graphql queries you need to add a variable in HEADER just like AUTHORIZATION in Magento 2 . The Header for Store wise data is


for more Information you can check https://devdocs.magento.com/guides/v2.3/graphql/send-request.html#headers


I had a setup where one magento backend was used for two magento websites each with at least a store and a store_view. For me it was loading the same default store even though I had changed the MAGENTO_BACKEND_URL value.

In order to fix that I had to add the required STORE_VIEW_CODE in .env file under venia-concept in order to load the desired store.

For more information



Header Key and Value for postman graphql

// enter header key as 'Store' and value as store code e.g ar
Store - ar

// enter header key as 'content-currency' and value as store code e.g AED
content-currency - AED


namespace Vendor\Module\Model\Resolver;

use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
use Magento\Framework\GraphQl\Exception\GraphQlAuthorizationException;
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;

class ExampleClass implements ResolverInterface
     * @inheritdoc
    public function resolve(
        Field $field,
        ResolveInfo $info,
        array $value = null,
        array $args = null
    ) {
        // get store and currency from graphql
        $store = $context->getExtensionAttributes()->getStore();
        $currency = $store->getCurrentCurrencyCode();
        $store = $store->getCode();

        $data = $offer->getData();
        $data['model'] = $offer;

        return ['offer' => 'test data'];

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.