Clement Clarke
Clement Clarke

Reputation: 11

How would you time out a graphQL query

Looking around in documentation relating to graphQL. I have not been able to find out how to time out a query that is taking a long time to return a response.

The server can be started with :

server.listen(4000, '0.0.0.0') => { console.log(Server ready); });

Any help would be appreciated.

Upvotes: 1

Views: 397

Answers (1)

Kn3cht
Kn3cht

Reputation: 172

You can set the timeout by adding:

server.listen(4000, '0.0.0.0') => { console.log(Server ready); })
.then(s => s.setTimeout(<your timeout in millis>));;


Upvotes: 1

Related Questions