The Home for Magento 2 Excellence

Quality-tested Magento 2 modules. Explore. Evaluate. Elevate. #magento2

1090 Modules
617 Ready
473 Need Help
🏆 Leaderboard
Stale v0.0.2

Yireo GraphQL Schema Manipulation

yireo/magento2-graph-ql-schema-manipulation

Provides a framework to manipulate the Magento 2 GraphQL schema before it is used, letting developers remove or alter fields and endpoints added by other extensions.

508
Downloads
Below average
0
GitHub Stars
1y ago
Last Release
0
Open Issues
Build Passing
Ready to install

Build Tests

Composer Install
DI Compile
Templates

Code Quality

CS Coding Standard
5 warnings
L3 PHPStan

Tested on Magento 2.4.9

Recent Test History

Each release is tested against the latest Magento version at that time.

v0.0.2 on Magento 2.4.9
Jun 3, 2026

Share This Module's Status

Yireo GraphQL Schema Manipulation Magento compatibility status badge

README

Loaded from GitHub

Yireo GraphQlSchemaManipulation

Magento 2 module to manipulate the GraphQL schema before it is being used. This can be useful when trying to remove endpoints that are added by monolithic extensions and perhaps other use-cases.

Installation

composer require yireo/magento2-graph-ql-schema-manipulation
bin/magento module:enable Yireo_GraphQlSchemaManipulation

Usage

To manipulate the schema yourself, you will need to create a class similar to the following:

class ExampleSchemaManipulator implements \Yireo\GraphQlSchemaManipulation\Schema\ManipulationInterface
{
    public function manipulateFieldsConfig(array $config): array
    {
        foreach ($config as $fieldIndex => $field) {
            if (in_array($fieldIndex, ['isEmailAvailable'])) {
                unset($config[$fieldIndex]);
            }
        }

        return $config;
    }
}

Next, create a di.xml file that adds this class to this module:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Yireo\GraphQlSchemaManipulation\Plugin\AddSchemaManipulators">
        <arguments>
            <argument name="schemaManipulators" xsi:type="array">
                <item name="example" xsi:type="object">ExampleSchemaManipulator</item>
            </argument>
        </arguments>
    </type>
</config>

This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.