# graycore/magento2-graphql-introspection-cache

`composer require graycore/magento2-graphql-introspection-cache`

Canonical URL: https://packagento.com/graycore/magento2-graphql-introspection-cache

## At a glance

- **Vendor**: graycore (https://packagento.com/graycore.md)
- **Latest version**: 0.2.2 — released 2026-05-18
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/graycore/magento2-graphql-introspection-cache and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require graycore/magento2-graphql-introspection-cache:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## README

<div align="center">

[![Packagist Downloads](https://img.shields.io/packagist/dm/graycore/magento2-graphql-introspection-cache?color=blue)](https://packagist.org/packages/graycore/magento2-graphql-introspection-cache/stats)
[![Packagist Version](https://img.shields.io/packagist/v/graycore/magento2-graphql-introspection-cache?color=blue)](https://packagist.org/packages/graycore/magento2-graphql-introspection-cache)
[![Packagist License](https://img.shields.io/packagist/l/graycore/magento2-graphql-introspection-cache)](https://github.com/graycoreio/magento2-graphql-introspection-cache/blob/master/LICENSE)
[![MageCheck Status](https://img.shields.io/github/actions/workflow/status/graycoreio/magento2-graphql-introspection-cache/check-extension.yaml?&label=MageCheck&labelColor=1a1a1a)](https://github.com/graycoreio/magento2-graphql-introspection-cache/actions/workflows/check-extension.yaml)
![MageCheck Supported Version](https://img.shields.io/badge/currently_supported-any?label=MageCheck%20Supported&labelColor=1a1a1a&color=090c9b)

</div>


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](https://getcomposer.org/). From the root of your Magento 2 project:

1. Download the package
```bash
composer require graycore/magento2-graphql-introspection-cache
```
2. Enable the package

```bash
./bin/magento module:enable Graycore_GraphQlIntrospectionCache
```

### Usage

You can add your own introspection cache identity by adding a bit of di.xml:

```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](https://devdocs.magento.com/guides/v2.4/graphql/develop/identity-class.html).

### 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](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.2.2](https://github.com/graycoreio/magento2-graphql-introspection-cache/compare/v0.2.1...v0.2.2) (2026-05-18)


#### Miscellaneous Chores

* **deps-dev:** upgrade to phpunit/phpunit:^12 and magento/magento-coding-standard:^40 ([8534f44](https://github.com/graycoreio/magento2-graphql-introspection-cache/commit/8534f44b8a2e759b0c8afe12c1386bf5afb39b23))
* **deps:** bump graycoreio/github-actions-magento2 from [@main](https://github.com/main) to 8.2.0 ([31a98bb](https://github.com/graycoreio/magento2-graphql-introspection-cache/commit/31a98bb7b2702127ab2db27f56ed6b124e87d71f))

### [0.2.1](https://github.com/graycoreio/magento2-graphql-introspection-cache/compare/v0.2.0...v0.2.1) (2026-03-04)


#### Miscellaneous Chores

* remove nodejs deps ([35fb2ec](https://github.com/graycoreio/magento2-graphql-introspection-cache/commit/35fb2ecd25e157830f58f94f61ef0edd173d8ca7))

### [0.2.0](https://github.com/graycoreio/magento2-graphql-introspection-cache/compare/v0.1.2...v0.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](https://github.com/graycoreio/magento2-graphql-introspection-cache/commit/b553e478482c268e7d925b2c2c37c65ece63ffa7))
* drop support for php 7.4 ([ff3e180](https://github.com/graycoreio/magento2-graphql-introspection-cache/commit/ff3e1806b04077639b32a0cfffc0e2ac0b93f746))


#### Bug Fixes

* 8.2 deprecation of constructor existence check ([db26ebb](https://github.com/graycoreio/magento2-graphql-introspection-cache/commit/db26ebb2197ca40d49fbc104f643135667c9ea5d))
* add check for Executor::getDefaultArgsMapper for older versions ([d460fca](https://github.com/graycoreio/magento2-graphql-introspection-cache/commit/d460fca3c0e488258d7ab130a41c84f5dc6144a9))
* backwards compat with webonyx 14.11.0 for v2.4.5-p11 and v2.4.4-p12 ([1484b89](https://github.com/graycoreio/magento2-graphql-introspection-cache/commit/1484b8920321e89fa8a102484505b14cbc28e934))


#### Miscellaneous Chores

* add dealerdirect/phpcodesniffer-composer-installer allowed plugin ([50b990a](https://github.com/graycoreio/magento2-graphql-introspection-cache/commit/50b990aec401e2e44f946d1d36215efe46f0a113))

#### [0.1.2](https://github.com/graycoreio/magento2-graphql-introspection-cache/compare/v0.1.1...v0.1.2) (2022-08-25)


#### Bug Fixes

* ensure reference executor always returns a new object ([#6](https://github.com/graycoreio/magento2-graphql-introspection-cache/issues/6)) ([9daede3](https://github.com/graycoreio/magento2-graphql-introspection-cache/commit/9daede31b3de7cab58973bdb54ed9a636560bd01))

#### 0.1.1 (2022-07-21)


#### Features

* add readme/license ([#3](https://github.com/graycoreio/magento2-graphql-introspection-cache/issues/3)) ([f74262a](https://github.com/graycoreio/magento2-graphql-introspection-cache/commit/f74262ae249834f1fed3a82ece2c66a17719c777))
* allow executor plugin to work with older webonyx graphql versions ([#2](https://github.com/graycoreio/magento2-graphql-introspection-cache/issues/2)) ([1501383](https://github.com/graycoreio/magento2-graphql-introspection-cache/commit/1501383fd3adaa34d8a2a29ab94abbfecd1a917c))

## Recent Versions

| Version | Released |
|---|---|
| 0.2.2 | 2026-05-18 |
| 0.2.1 | 2026-03-04 |
| 0.2.0 | 2025-02-26 |
| 0.1.2 | 2022-08-25 |
| 0.1.1 | 2022-07-21 |
| 0.1.0 | 2022-07-21 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| 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 |
| php | >=8.1 |

### Require (dev)

| Package | Constraint |
|---|---|
| magento/magento-coding-standard | ^40 |
| magento/php-compatibility-fork | ^0.1.0 |
| phpunit/phpunit | ^12.0 |
| squizlabs/php_codesniffer | ^3.0 |

## Quality

Latest release (0.2.2) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| 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. Never affect the Compatibility verdict — 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.

| 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 against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| 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 per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| 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

| 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

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["graycore/magento2-graphql-introspection-cache"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

graycore is a Magento 2 vendor on Packagento. See https://packagento.com/graycore.md for their full catalogue.

