Companion modules
Stock Magento 2.4.8 GraphQL does not cover everything the storefront needs. Each gap is closed by a small companion module instead of a change to core Magento.
Rules every module follows
Section titled “Rules every module follows”- GraphQL only for the storefront. No PHTML, layout XML or storefront controllers.
- Backend and GraphQL split. A feature with a storefront part is two modules: the backend (data, admin, email, cron) and a
GraphQlmodule with the schema and resolvers. Magento splitsCatalogandCatalogGraphQlthe same way. - Minimal admin settings. Settings live under Stores > Configuration > Magenx, or next to the stock feature they extend.
- Safe on listing grids. A field selected on product cards is resolved for the whole page at once, never one product at a time.
- Own repository. Each module is
magenxcommerce/module-<name>, installed with Composer.
Keeping the storefront and modules in step
Section titled “Keeping the storefront and modules in step”Magento rejects a whole GraphQL document when it is asked for a field it does not define. If a storefront build runs ahead of its backend, a page does not lose one component: the whole query fails. The store config query runs on every page, so one missing field can take down the whole storefront.
The repository keeps a copy of each module’s GraphQL schema in magento/schemas/, plus the one third-party schema the storefront queries: Mollie’s (mollie/magento2). A test checks every field, argument and root query the engine uses against those schemas, so the mistake fails CI instead of production.
Module reference
Section titled “Module reference”Each module has a page with its settings, admin pages, permissions, cron jobs and GraphQL. See Companion modules.