Search by

inpost / magento2-module-restrictions-graph-ql

piotr.koziol

Module implements GraphQL fields and queries for InPost_Restrictions module.

Package info

github.com/FastWhiteCat/magento2-module-restrictions-graph-ql

Type:magento2-module

pkg:composer/inpost/magento2-module-restrictions-graph-ql

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

v3.1.2 2026-11-30 08:49 UTC

This package is not auto-updated.

Last update: 2026-12-01 11:08:46 UTC


README

Module adds GraphQL fields and queries for the InPost_Restrictions module, so PWA storefronts can hide the InPost Pay widget on the product page in the same way as Luma does.

License

  • This plugin is licensed under the Creative Commons BY-NC-ND 4.0 License.
  • You are free to use this plugin in its original, unmodified form for non-commercial purposes only.
  • Redistribution, modification, and commercial use are strictly prohibited.
  • License details: http://creativecommons.org/licenses/by-nc-nd/4.0/

Compatibility

  • Magento Community 2.4.6
  • Not tested in other versions

Installation

To enable this extension run following commands:

  • bin/magento module:enable InPost_RestrictionsGraphQl
  • bin/magento setup:upgrade
  • bin/magento setup:di:compile (production mode)

Product restrictions (inpost_pay_product_restrictions)

true means the product cannot be bought via InPost Pay on the current website: no InPost delivery method is allowed for it by the restriction rules (a rule for both delivery methods, or an APM rule and a Courier rule on the same website). Hide the InPost Pay widget on the product page when the value is true.

A product restricted only for APM (or only for Courier) returns false: the widget stays visible and InPost Pay offers only the allowed delivery method.

For configurable products pass the product shown on the product page (the parent), as Luma does.

Field on ProductInterface, e.g. on the product page products query:

{
    products(filter: { sku: { eq: "24-MB01" } }) {
        items {
            sku
            inpost_pay_product_restrictions
        }
    }
}

Standalone query by SKU:

{
    inPostPayProductRestrictions(sku: "24-MB01") {
        inpost_pay_product_restrictions
    }
}

The query returns a "Product with SKU ... not found." error for an unknown SKU, a disabled product and a product that is not assigned to the current website.

Both are cached with the product cache tag, which is cleaned when refreshed restriction rules change the product.

Cart, minicart and checkout: the widget there is not hidden based on restrictions. Display is controlled only by the StoreConfig flags (inpost_pay_show_on_cart, inpost_pay_show_in_minicart, ...), as on Luma.