graycore / magento2-graphql-introspection-cache
graycore/magento2-graphql-introspection-cache
Magento 2 GraphQL Introspection Cache
This module allows you to use the same mechanism that is used for caching regular GraphQL resolvers, for introspection queries.
This helps minimize the number of times Magento is bootstrapped.
The following introspection types are supported out of the box:
- ProductAttributeFilterInput
This module is experimental, it contains BC-fixes for older Magento versions (<2.4.2). Class internals will likely change when support for those versions end.
Getting Started
This module is intended to be installed with composer. From the root of your Magento 2 project:
- Download the package
composer require graycore/magento2-graphql-introspection-cache
- Enable the package
./bin/magento module:enable Graycore_GraphQlIntrospectionCache
Usage
You can add your own introspection cache identity by adding a bit of di.xml:
<type name="Graycore\GraphQlIntrospectionCache\Plugin\CachePlugin">
<arguments>
<argument xsi:type="array" name="introspectionHandlers">
<item xsi:type="object" name="NameOfInspectedType">Namespace\Module\Model\Cache\Identity\Introspection\NameOfInspectedType</item>
</argument>
</arguments>
</type>
Your class must implement Magento\Framework\GraphQl\Query\Resolver\IdentityInterface.
For more information on GraphQL Cache Identities, please visit the official documentation.
Internals
- A before plugin is created on
QueryProcessor::processto set a customReferenceExecutor. ThisReferenceExecutoris instantiated using the Object Manager, so that we can use plugins on it in a later stage. - An after plugin is created on
ReferenceExecutor::doExecute. This plugin determines if we are dealing with an introspection request and if there is a cache identity registered for it. If there is, it will attempt to generate cache tags and add it to the request.
Check out the unit/integration tests to get a better picture.
Changelog
All notable changes to this project will be documented in this file. See standard-version for commit guidelines.
0.2.2 (2026-05-18)
Miscellaneous Chores
- deps-dev: upgrade to phpunit/phpunit:^12 and magento/magento-coding-standard:^40 (8534f44)
- deps: bump graycoreio/github-actions-magento2 from @main to 8.2.0 (31a98bb)
0.2.1 (2026-03-04)
Miscellaneous Chores
- remove nodejs deps (35fb2ec)
0.2.0 (2025-02-26)
⚠ BREAKING CHANGES
- We no longer support php 7.4 as it is end of life.
Features
- compat with GraphQL\Executor\ReferenceExecutor from webonyx/graphql-php:15.18.1 (b553e47)
- drop support for php 7.4 (ff3e180)
Bug Fixes
- 8.2 deprecation of constructor existence check (db26ebb)
- add check for Executor::getDefaultArgsMapper for older versions (d460fca)
- backwards compat with webonyx 14.11.0 for v2.4.5-p11 and v2.4.4-p12 (1484b89)
Miscellaneous Chores
- add dealerdirect/phpcodesniffer-composer-installer allowed plugin (50b990a)
0.1.2 (2022-08-25)
Bug Fixes
0.1.1 (2022-07-21)
Features
| Version | Stability | QA Status | Compatibility | Released |
|---|---|---|---|---|
| 0.2.2 | stable | Fail | Magento 2.4.7-2.4.9 Details | 2026-05-18 13:54:17 |
| 0.2.1 | stable | Not tested | Not yet tested Details | 2026-03-04 18:19:18 |
| 0.2.0 | stable | Not tested | Not yet tested Details | 2025-02-26 15:35:17 |
| 0.1.2 | stable | Not tested | Not yet tested Details | 2022-08-25 20:19:37 |
| 0.1.1 | stable | Not tested | Not yet tested Details | 2022-07-21 17:07:03 |
| 0.1.0 | stable | Not tested | Not yet tested Details | 2022-07-21 15:08:36 |
Requires 6
| Package | Constraint |
|---|---|
| php | >=8.1 |
| magento/framework | ^102.0 || ^103.0 |
| magento/module-catalog | ^103.0 || ^104.0 |
| magento/module-eav | ^102.0 |
| magento/module-graph-ql | ^100.0.0 |
| magento/module-graph-ql-cache | ^100.0.0 |
Requires-dev 4
| Package | Constraint |
|---|---|
| magento/magento-coding-standard | ^40 |
| magento/php-compatibility-fork | ^0.1.0 |
| phpunit/phpunit | ^12.0 |
| squizlabs/php_codesniffer | ^3.0 |
Compatibility
Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.
Code Quality
Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge — a phpcs finding can't make a module incompatible.
Static analysis
Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.
PHPStan
Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases. Cell → details modal.
Tests
Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.
Unit tests
Security
Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.
More from graycore
View vendorTurn an existing module into recurring revenue.
If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.