Graphql-engine: Increase response timeout for remote schemas

Created on 10 Jul 2019  路  5Comments  路  Source: hasura/graphql-engine

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.

console remote-schemas server easy enhancement high

Most helpful comment

@FabianKramm Here is the PR for this feature: https://github.com/hasura/graphql-engine/pull/2740

All 5 comments

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

egislook picture egislook  路  3Comments

sachaarbonel picture sachaarbonel  路  3Comments

leoalves picture leoalves  路  3Comments

tirumaraiselvan picture tirumaraiselvan  路  3Comments

hooopo picture hooopo  路  3Comments