Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions src/monday_sdk/client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Dict, Optional

from .modules import BoardModule, ItemModule, UpdateModule, CustomModule, ActivityLogModule, DocsModule
from .constants import API_VERSION, DEFAULT_MAX_RETRY_ATTEMPTS
from .graphql_handler import MondayGraphQL
Expand All @@ -6,15 +8,21 @@


class MondayClient:
def __init__(self, token, headers=None, debug_mode=False, max_retry_attempts=DEFAULT_MAX_RETRY_ATTEMPTS):
def __init__(
self,
token: str,
headers: Optional[Dict[str, str]] = None,
debug_mode: bool = False,
max_retry_attempts: int = DEFAULT_MAX_RETRY_ATTEMPTS,
) -> None:
headers = headers or BASE_HEADERS.copy()

# Create a single GraphQL client instance
self._graphql_client = MondayGraphQL(
token=token,
headers=headers,
debug_mode=debug_mode,
max_retry_attempts=max_retry_attempts
max_retry_attempts=max_retry_attempts,
)

# Pass the GraphQL client to each module
Expand Down