hasura / hasura/graphql-engine
Settings. Different configuration of timeouts and retries for subscriptions, queries and mutations
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Is your proposal related to a problem?
Subscriptions, queries and mutations in general has different execution time:
- subscriptions makes no sense if they are executed longer then refetch interval (default = 1s)
- queries could be quite heavy, several seconds for big amounts of data
- mutations could be heavy too, with possibiltiy of locks
It would be beneficial if it was possible to tune different timeouts and retries for subscriptions, queries and mutations:
- aggressively small for subscriptions. E.g. 150-200 ms with infinite retries
- several seconds for queries and mutations. E.g. 10-15 seconds timeout with limited retries
### Describe the solution you'd like
Ability to have different PGConnectionParameters and PGPoolSettings for subscriptions, queries and mutations.
### Describe alternatives you've considered
Unfortunately PostgreSQL does not allows to specify `statement_timeout` inside function.
Second hasura deployed as remote schema - looks too heavy and complex for the purpose.
Requesting a possibility to assign timeouts and retries for a named query - seems overkill.
### If the feature is approved, would you be willing to submit a PR?
Sorry, I'm not a haskeler yet
Contributor guide
Research direction
Start by tracing the PGConnectionParameters and PGPoolSettings named in the proposal, then compare how subscriptions, queries, and mutations select their execution settings. Done means each operation category can use distinct timeout and retry configuration, with behavior verified for the requested categories.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, haskell, postgresql
- Domain
- api, backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100