@envelop/rate-limiter
Version:
This plugins uses [`graphql-rate-limit`](https://github.com/teamplanes/graphql-rate-limit#readme) in order to limit the rate of calling queries and mutations.
18 lines (17 loc) • 566 B
TypeScript
import type { Identity } from './types.js';
declare abstract class Store {
/**
* Sets an array of call timestamps in the store for a given identity
*
* @param identity
* @param timestamps
*/
abstract setForIdentity(identity: Identity, timestamps: readonly number[], windowMs?: number): void | Promise<void>;
/**
* Gets an array of call timestamps for a given identity.
*
* @param identity
*/
abstract getForIdentity(identity: Identity): readonly number[] | Promise<readonly number[]>;
}
export { Store };