Skip to content

Add timeout parameter to request#85

Merged
damian-rakus merged 21 commits intomainfrom
feature/damianra/add-timeout-param
Jan 20, 2026
Merged

Add timeout parameter to request#85
damian-rakus merged 21 commits intomainfrom
feature/damianra/add-timeout-param

Conversation

@damian-rakus
Copy link
Copy Markdown
Collaborator

@damian-rakus damian-rakus commented Jan 12, 2026

This PR adds the ability to specify timeout for GraphQL queries.

- Extended RequestOptions interface to include optional timeout parameter in milliseconds
- Implemented timeout logic with AbortController in request() method
- Implemented timeout logic with AbortController in rawRequest() method
- Added comprehensive test coverage for timeout scenarios
- Tests cover: successful requests before timeout, timeout triggering, no timeout, and error handling
Comment on lines +11 to +17
```
import { ApiClient } from '@mondaydotcomorg/api';

const client = new ApiClient({token: '<API-TOKEN>'});

client.request('<QUERY>', undefined, { timeout: 20_000 })
```
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mesant this can be cool in the readme, not only changelog, or atleast jutt mention the option in the readme

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added also example to README

@damian-rakus damian-rakus merged commit 689514e into main Jan 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants