I just released graphql-safe-guards, a tiny open-source utility that helps protect GraphQL APIs from expensive queries.
It combines two essential protections:
Query depth limiting
Query complexity validation
Unlike directive-based or runtime plugins, it relies on native GraphQL validation rules, making it:
Framework-agnostic
Predictable
Zero runtime overhead
If you’re running GraphQL in production and want simple, portable query safety, this might help.
For those interested, here’s the npm package and source code 👇
npm: https://www.npmjs.com/package/graphql-safe-guards
GitHub: https://github.com/Mateodiaz401/graphql-safe-guards
Top comments (0)