1

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?

2

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

Store:

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

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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