How to use the graphql-rate-limit-directive.defaultKeyGenerator function in graphql-rate-limit-directive

To help you get started, we’ve selected a few graphql-rate-limit-directive examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ravangen / graphql-rate-limit / examples / context / index.js View on Github external
const keyGenerator = (directiveArgs, obj, args, context, info) =>
  `${context.ip}:${defaultKeyGenerator(
    directiveArgs,
    obj,
    args,
    context,
    info,
  )}`;

graphql-rate-limit-directive

Fixed window rate-limiting directive for GraphQL. Use to limit repeated requests to queries and mutations.

MIT
Latest version published 11 months ago

Package Health Score

64 / 100
Full package analysis