Timeouts

The other attack vector is to make a query that takes a long time to execute. There are broadly two types of timeouts:

Database timeout: If a database connection or a query takes a long time to respond, Hasura can return a timeout error. There's a statement_timeout setting in Postgres to abort any statement execution that's taking longer than specified milliseconds. This is just a configuration at the database layer (Postgres in this case).

HTTP timeout: If you are using Actions/Remote Schemas/Events, you would have configured HTTP endpoints for respective requests. You can configure a timeout setting as well to abort the query execution. HTTP endpoints make different queries in their underlying logic, and configuring a timeout is recommended to abort connections and respond quickly to the client.

Did you find this page helpful?
Start with GraphQL on Hasura for Free
  • ArrowBuild apps and APIs 10x faster
  • ArrowBuilt-in authorization and caching
  • Arrow8x more performant than hand-rolled APIs
Promo
footer illustration
Brand logo
© 2024 Hasura Inc. All rights reserved
Github
Titter
Discord
Facebook
Instagram
Youtube
Linkedin
graphql-handbook