wikijs-fork/server/graph/directives/rate-limit.js

6 lines
246 B
JavaScript
Raw Normal View History

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