Yireo_HyvaWithoutGraphQl
Replaces the GraphQL calls of various Hyvä templates with regular Magento controllers.
What it does
A few Hyvä templates fetch their data from the GraphQL endpoint. This module replaces those calls with regular Magento frontend controllers, so that the storefront no longer depends on the GraphQL API for these features.
| Hyvä template | Alpine component | Method | How |
|---|---|---|---|
| Magento_Review::customer/list.phtml | initReviewList | getReviewsList | JS proxy |
| Magento_Catalog::product/widget/viewed/js/recently-viewed-products.phtml | initRecentlyViewedProductsComponent | fetchProducts | JS proxy |
| Magento_Review::form.phtml | initReviewForm | placeReview | JS proxy |
| Magento_Theme::elements/slider.phtml | initSliderComponent<uniqid> | getProducts | template replacement |
The first three are left intact: an extra template is rendered right after the original one, which wraps the global component factory and swaps out that single method. The deprecated GraphQL product slider is replaced entirely, because its query is built from block arguments that only exist server side.
Both are done from a single plugin on Magento\Framework\View\TemplateEngine\Php, so widgets and
dynamically named blocks are covered as well. The template maps are DI arguments of
Yireo\HyvaWithoutGraphQl\Plugin\TemplateEngine\SwapGraphQlTemplates, so individual entries can be
removed in a project.
The controllers answer with exactly the same data structure as the GraphQL responses they replace, which is why the Hyvä templates keep rendering unchanged.
| Route | Method | Replaces |
|---|---|---|
| hyva-without-graphql/reviews/customer | GET | customer.reviews |
| hyva-without-graphql/reviews/save | POST | createProductReview |
| hyva-without-graphql/products/skus | GET | products(filter: {sku: {in: []}}) |
| hyva-without-graphql/products/slider | GET | the slider products query |
Installation
Install this package via composer (provided you have properly configured our composer API first):
composer require yireo/magento2-hyva-without-graph-ql
Next, enable this module:
bin/magento module:enable Yireo_HyvaWithoutGraphQl bin/magento setup:upgrade
Configuration
Stores > Configuration > General > Hyvä Without GraphQL > Settings > Enabled
(yireo_hyva_without_graph_ql/settings/enabled, default 1). When switched off, the templates are
left untouched and the controllers answer with a 404.
Security
reviews/savevalidates the Magento form key itself and answers with JSON instead of a redirect, and validates reCAPTCHA for form idproduct_reviewwhen it is configured.reviews/customeronly ever returns the reviews of the customer in the current session.- The slider parameters travel over the URL. The page size is capped at 100 and the sort attribute is limited to a whitelist.
- All responses are sent with
Cache-Control: no-store, since they depend on store, currency, customer group or customer session.
Notes and limitations
- A slider block that is configured with a custom
graphql_queryargument is no longer honoured. The structured arguments (product_skus,category_ids,price_from,price_to,page_size,sort_attribute,sort_direction,type) andproduct_filtersare supported.product_filtersis parsed byYireo\HyvaWithoutGraphQl\Model\ProductFilterParser, which understandseq,neq,in,nin,from,to,gt,gteq,lt,lteq,likeandmatch. Anything else is ignored and logged. - The recently viewed proxy only comes into play when
catalog/recently_products/synchronize_with_backendis enabled. Without it, Hyvä renders the widget straight from browser storage and never calls GraphQL in the first place. - The customer review list no longer waits for the GraphQL
signin_tokenof the private content section; the session cookie is enough for a regular controller. price_range.minimum_price.base_pricestays absent, matching the original GraphQL query.- The replacement slider template fixes two typos of the original:
getprevButtonClasses(nowgetPrevButtonClasses) andfillerSlideNumer(nowfillerSlideNumber). It also usesx-textinstead ofx-htmlfor the product name.
Current status
Support
For getting support, create an Issue under the following project URL:
https://github.com/yireo/Yireo_HyvaWithoutGraphQl
Configuration Options
The following options of this module can be configured via the Store Configuration:
yireo_hyva_without_graph_ql/settings/enabled
Module Dependencies
The following dependencies are declared in the module its `etc/module.xml` file:
Hyva_Theme
Magento_AdminNotification
Magento_Authorization
Magento_Backend
Magento_Catalog
Magento_CatalogGraphQl
Magento_CatalogInventory
Magento_Checkout
Magento_Cms
Magento_Config
Magento_Csp
Magento_Customer
Magento_Directory
Magento_Eav
Magento_EavGraphQl
Magento_GraphQl
Magento_GraphQlResolverCache
Magento_Indexer
Magento_Payment
Magento_Quote
Magento_QuoteGraphQl
Magento_ReCaptchaUi
Magento_ReCaptchaValidationApi
Magento_Review
Magento_Rule
Magento_Sales
Magento_SalesSequence
Magento_Search
Magento_Store
Magento_StoreGraphQl
Magento_Theme
Magento_Variable
Composer details
Yireo_HyvaWithoutGraphQlyireo/magento2-hyva-without-graph-ql
ext-pcre: *
hyva-themes/magento2-theme-module: ^1.5
magento/framework: ^103.0
magento/module-backend: ^102.0
magento/module-catalog: ^104.0
magento/module-checkout: ^100.4
magento/module-config: ^101.2
magento/module-customer: ^103.0
magento/module-re-captcha-ui: ^1.1
magento/module-re-captcha-validation-api: ^1.1
magento/module-review: ^100.4
magento/module-store: ^101.1
php: ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0
psr/log: ^1.0 || ^2.0 || ^3.0
Releases
| 0.0.1 | 25 October 2026 |
Changelog
[0.0.1] - 13 October 2026
Added
- Plugin
SwapGraphQlTemplatesonMagento\Framework\View\TemplateEngine\Phpthat replaces or extends Hyvä templates containing a GraphQL call. - JS proxies for
initReviewList::getReviewsList,initReviewForm::placeReviewandinitRecentlyViewedProductsComponent::fetchProducts. - GraphQL-free replacement of
Magento_Theme::elements/slider.phtml. - Frontend controllers
hyva-without-graphql/reviews/customer,hyva-without-graphql/reviews/save,hyva-without-graphql/products/skusandhyva-without-graphql/products/slider. - Store configuration
yireo_hyva_without_graph_ql/settings/enabledto switch the module off per store. - Unit tests for the filter parser, the request normalizer and the template plugin, plus integration tests for the four controllers.
Changed
- Added
phpandmagento/module-themerequirements tocomposer.json. - Synchronised
MODULE.jsonsequence withetc/module.xmland enabled PHPStan level 5 and PHPCS severity 6 in CI. - Made the GraphQL marker detection in
SwapGraphQlTemplatescase-insensitive. - Documented the CSRF bypass in
Reviews\Saveand clarifiedCustomerReviewProviderPHPDoc.