GraphQLGate is a rate-limiting library for Node.js and Express that uses query complexity analysis to prevent abusive GraphQL queries. It assigns weights to fields, mutations, and queries to estimate response size, then throttles requests based on token bucket, fixed window, or sliding window algorithms backed by Redis. Version 1.3.0 is current; developed under OSLabs, inspired by IBM research. Key differentiators: depth limits, bounded list enforcement, and customizable type weights. Ships TypeScript definitions.
npm install graphql-limiterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates GraphQL rate limiting with token bucket algorithm, depth limit, and bounded list enforcement on an Express server.
Start Redis server (e.g., redis-server) or use mocked Redis in development.
Set enforceBoundedLists: true or annotate all list fields with @listSize.
Rename 'graphqlLimiter' to 'rateLimiter' in config.
Use multiple instances for different complexity tiers, or override via middleware per route.
Use token bucket or fixed window in clustered environments.
Run 'npm install graphql-limiter --save' and ensure import is correct.
Use 'import { expressGraphQLRateLimiter } from 'graphql-limiter' instead of default import.Start Redis server or set custom Redis options via config.redis.options.
Increase rateLimiter.capacity or refillRate, or simplify the query.