ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 21 - AD0-E722 discussion

Report
Export

A single Adobe Commerce Cloud instance is set up with two websites (each with a single store view) with different domains.

* The default website is website_one, with store view store_one, and domain storeone. com.

* The second website is website_two, with store view store_two, and domain storetwo. com.

The magento-vars. php file is set up as follows to determine which website each request runs against:

When testing a new GraphQL integration, all requests returned data relating to the default website, regardless of the domain. What is causing this issue?

A.
The magento-vars.php file is not processed for any GraphQL requests, so the default website is always processed.
Answers
A.
The magento-vars.php file is not processed for any GraphQL requests, so the default website is always processed.
B.
$_server['mage_run_cooe') needs to be set to store and *$_SERVER['MAGE_RUN_TYPE'] needs to be set to the store code instead.
Answers
B.
$_server['mage_run_cooe') needs to be set to store and *$_SERVER['MAGE_RUN_TYPE'] needs to be set to the store code instead.
C.
GraphQL requests are always run against the default store view unless a store header or store cookie is provided.
Answers
C.
GraphQL requests are always run against the default store view unless a store header or store cookie is provided.
Suggested answer: C

Explanation:

The magento-vars.php file is used to set the website or store view based on the HTTP host, but it does not affect GraphQL requests. GraphQL requests are handled by a separate controller that does not use the magento-vars.php file. Instead, GraphQL requests use the default store view of the default website, unless a store header or store cookie is provided in the request. The store header or cookie should contain the store code of the desired store view.For example, to query data from website_two, the request should include a header likestore: store_twoor a cookie likestore=store_two12.Reference:

GraphQL overview | Adobe Commerce 2.4 User Guide - Magento

How to set up multiple websites with Magento 2 - Mageplaza

asked 02/10/2024
Brent Varona
25 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first