How do I add a custom GraphQL resolver without breaking the schema cache?

Three files, in this order. (1) etc/schema.graphqls, declare the type and the field; (2) a Resolver class implementing Magento\Framework\GraphQl\Query\ResolverInterface; (3) wire it in the schema with @resolver(class: "Vendor\\Module\\Resolver\\Foo"). After every schema edit run bin/magento cache:clean config graphql_query_resolver_cache. Don't skip config, the schema-stitcher caches the parsed AST there, not under graphql_query_resolver_cache. If your new field still 404s, run bin/magento setup:di:compile; resolver-class autoloading goes through generated factories.

Kishan Savaliya
Kishan Savaliya
Adobe Certified Magento Commerce Developer
Ahmedabad [IN]working hours, replies within four hours
When do you need it

Read personally. Never shared. Or email the brief.

More on claude, magento playground

Need it fixed, not just explained?

Send the brief with your store URL; the written quote comes back within 24 hours.