File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 22
33This example has a few mechanisms to prevent your GraphQL server from dealing with expensive queries sent by abusive clients
44(or maybe legitimate clients that running expensive queries unaware of the negative impacts they might cause).
5+ Also, it has a couple of timeout strategies that, although won't help ease the burden on the server (since the expensive
6+ operations are already under way), will provide a better experience to the consumer that won't have to wait forever for
7+ their requests to return.
58
69Here we introduce 4 mechanisms to help with that task. 3 of them are based on GraphQL Java instrumentation capabilities,
710and the forth one is a bit out GraphQL Java jurisdiction and more related to web servers.
@@ -11,6 +14,9 @@ and the forth one is a bit out GraphQL Java jurisdiction and more related to web
11143 . A custom Instrumentation that sets a timeout period of 3 seconds for DataFetchers
12154 . A hard request timeout of 10 seconds, specified in the web server level (Spring)
1316
17+ The first 2 items will actually prevent server overload, since they act before the request reach the DataFetchers, which
18+ perform the expensive operations. Number 3 and 4 are timeouts that force long running executions to return early to customers.
19+
1420# The schema
1521The schema we're using is quite simple:
1622
You can’t perform that action at this time.
0 commit comments