INNER CODE UNIT · TypeScript
defaultPointsCalculator
ravangen/graphql-rate-limit · src/index.ts:195
export function defaultPointsCalculator<TContext>(
/* eslint-disable @typescript-eslint/no-unused-vars */
directiveArgs: RateLimitArgs,
source: unknown,
args: { [key: string]: unknown },
context: TContext,
info: GraphQLResolveInfo,
/* eslint-enable @typescript-eslint/no-unused-vars */
): number {
return 1;
}
/**
* Raise a rate limit error when there are too many requests.
* @param response The current rate limit information for this field.
* @param directiveArgs The arguments defined in the schema for the directive.
* @param source The previous result returned from the resolver on the parent field.
* @param args The arguments provided to the field in the GraphQL operation.