We currently use the hasura graphql-engine with a custom remote schema that implements certain special graphql mutations. Some of these mutations can run longer than 30 seconds, which seems to be the default http request timeout of hasura. After the 30 seconds we receive the following error:
{
"errors": [
{
"extensions": {
"path": "$",
"code": "unexpected"
},
"message": "HttpExceptionRequest Request {\n host = \"our-host\"\n port = 80\n secure = False\n requestHeaders = [(\"Content-Type\",\"application/json\"),(\"User-Agent\",\"hasura-graphql-engine/v1.0.0-beta.2\"),(\"x-hasura-role\",\"admin\")]\n path = \"/graphql\"\n queryString = \"\"\n method = \"POST\"\n proxy = Nothing\n rawBody = False\n redirectCount = 10\n responseTimeout = ResponseTimeoutDefault\n requestVersion = HTTP/1.1\n}\n ResponseTimeout"
}
]
}
It would be nice if the response timeout for remote schemas would be configurable or at least could be increased to something higher than 30 seconds, which seems pretty short to us.
Hi @FabianKramm
I have marked this as a feature and we'll take it up in the upcoming releases.
However, you can also make the long-running mutations as background jobs and use [event triggers] to trigger the jobs. That way your mutation will return immediately. But you do have to architect your entire app around that pattern.
I have similar problem. suggested workaround is quite refactoring.
This will be added in the next release.
@FabianKramm Here is the PR for this feature: https://github.com/hasura/graphql-engine/pull/2740
@tirumaraiselvan Perfect! Thanks so much!
Most helpful comment
@FabianKramm Here is the PR for this feature: https://github.com/hasura/graphql-engine/pull/2740