MichalLytek / MichalLytek/type-graphql

Fixed window rate limiting

Open
#338 2 comments 2 reactions 0 assignees View on GitHub
Community :family_man_girl: Discussion :speech_balloon: Enhancement :new:
Dominant language
TypeScript
Stars
8.1k
Forks
672
PR merge metrics
No merged PRs in 30d

Description

[Query cost/complexity validation/analysis](https://typegraphql.ml/docs/complexity.html) is not enough. See the following thread for more info: https://github.com/ravangen/graphql-rate-limit/issues/48.

TL;DR: Cost analysis won't care if you receive one request per second or a thousand. A malicious actor could craft an operation that remains under a cost limit, but send a large number of requests.

@19majkel94 Could you please add an example how to use the fixed window rate limiting in addition to query cost/complexity validation/analysis in `type-graphql`?

PTAL at https://github.com/ravangen/graphql-rate-limit and https://github.com/teamplanes/graphql-rate-limit.

Contributor guide

Open the contributing guide

Research direction

Start by reading the type-graphql complexity documentation and the linked graphql-rate-limit discussions, especially issue 48 and the teamplanes and ravangen examples. Identify where the documentation explains query cost or complexity validation, then add a fixed-window rate-limiting example alongside it. Done means the example clearly shows how both protections are used together.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
api, documentation, security
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.