wikijs-fork/server/graph/directives/rate-limit.js
2019-02-17 01:32:35 -05:00

6 lines
246 B
JavaScript

const { createRateLimitDirective } = require('graphql-rate-limit-directive')
module.exports = createRateLimitDirective({
keyGenerator: (directiveArgs, source, args, context, info) => `${context.req.ip}:${info.parentType}.${info.fieldName}`
})