Problem
timeout and maxRetries are configured once at client initialization and apply globally to every request. There is no way to override them for individual calls. A developer making a complex query may need a 60s timeout for that one call without affecting all other requests.
Proposed Behaviour
Each method accepts an optional options parameter to override the global defaults for that call only.
// Long timeout for one specific call, global default unchanged
const response = await client.query({ query: '...' }, { timeout: 60000, maxRetries: 0 })
- Overrides apply to that single call only
- Supported options:
timeout, maxRetries
- Global client config is never mutated
Files to Modify
| File |
Change |
src/client.ts |
Add optional RequestOptions second parameter to query(), getUsage(), getPlans() |
src/types.ts |
Add RequestOptions interface |
Acceptance Criteria
Problem
timeoutandmaxRetriesare configured once at client initialization and apply globally to every request. There is no way to override them for individual calls. A developer making a complex query may need a 60s timeout for that one call without affecting all other requests.Proposed Behaviour
Each method accepts an optional options parameter to override the global defaults for that call only.
timeout,maxRetriesFiles to Modify
src/client.tsRequestOptionssecond parameter toquery(),getUsage(),getPlans()src/types.tsRequestOptionsinterfaceAcceptance Criteria
query()accepts per-requesttimeoutandmaxRetriesgetUsage()andgetPlans()accept the same options