From 196c7634210d8fa03d7cf7af171aa54ce3eedcc1 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Thu, 7 Apr 2022 18:39:42 +1200 Subject: [PATCH] Add abuse limits --- app/controllers/api/graphql.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/api/graphql.php b/app/controllers/api/graphql.php index 7f1fbbeae..719ca453f 100644 --- a/app/controllers/api/graphql.php +++ b/app/controllers/api/graphql.php @@ -19,6 +19,10 @@ App::post('/v1/graphql') ->label('sdk.response.type', Response::CONTENT_TYPE_JSON) ->label('sdk.response.model', Response::MODEL_ANY) ->label('abuse-limit', 60) + ->label('abuse-time', 60) + ->param('query', '', new Text(1024), 'The query to execute. Max 1024 chars.') + ->param('operationName', '', new Text(256), 'Name of the operation to execute', true) + ->param('variables', [], new JSON(), 'Variables to use in the operation', true) ->inject('request') ->inject('response') ->inject('schema')