graycore / magento2-graphql-introspection-cache

graycore/magento2-graphql-introspection-cache

magento2-module Compatibility: 2.4.7-2.4.9 Code Quality: Fail Tests: Fail Security: Pass MIT

Magento 2 GraphQL Introspection Cache

Packagist Downloads
Packagist Version
Packagist License
MageCheck Status
MageCheck Supported Version

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:

  1. Download the package
composer require graycore/magento2-graphql-introspection-cache
  1. 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::process to set a custom ReferenceExecutor. This ReferenceExecutor is 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

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

  • ensure reference executor always returns a new object (#6) (9daede3)

0.1.1 (2022-07-21)

Features

  • add readme/license (#3) (f74262a)
  • allow executor plugin to work with older webonyx graphql versions (#2) (1501383)
Versions
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.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Pass
2.4.9 Pass Pass

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.

Static analysis results
Tool Status Findings Summary
PHPCS Pass 0
PHPMD Warning 4 4 rule violations (UndefinedVariable:2, MissingImport:1, UnusedLocalVariable:1)
Cpd Pass 0
Composer validate Info 2 valid; 2 advisory notes (composer validate --strict)

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.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 2 2
2.4.8 2 2
2.4.9 2 2

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

Unit tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 N/A N/A
2.4.8 N/A N/A
2.4.9 N/A N/A

Integration tests

Integration tests results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 Pass Pass
2.4.8 Pass Error
2.4.9 Pass not tested

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.

Security results
Tool Status Findings Summary
Composer audit Pass 0
License
MIT

More from graycore

View vendor
Make it pay

Turn 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.