Skip to content

API Reference parrot_tools.interfaces.gigsmart.client

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_tools.interfaces.gigsmart.client

View source

GigSmart GraphQL client — aiohttp-based transport with retry and error classification.

Features:

  • GraphQL POST via aiohttp.ClientSession with OAuth 2.1 header injection
  • Error classification: maps extensions.code to typed exceptions
  • Relay auto-pagination: fetch all nodes from a paginated connection
  • Retry with exponential backoff for transient errors (5xx, 429)
  • Concurrency limiting via asyncio.Semaphore
  • PII scrubbing in log output (controlled by config.log_pii)

Alias GigSmartAuth

Re-exported from parrot_tools.interfaces.gigsmart.auth.GigSmartAuth.

Alias GigSmartAuthError

Re-exported from parrot_tools.interfaces.gigsmart.exceptions.GigSmartAuthError.

Class GigSmartClient

aiohttp-based GraphQL client for the GigSmart API.

Usage::

config = GigSmartConfig(client_id="...", client_secret="...")
async with GigSmartClient(config) as client:
    data = await client.execute("query { viewer { id } }")
Parameter Type Default Description
config GigSmartConfig GigSmartConfig carrying endpoint URLs and credentials.

Method GigSmartClient.start

Open the underlying aiohttp.ClientSession.

start() -> None

Method GigSmartClient.close

Close the underlying aiohttp.ClientSession.

close() -> None

Method GigSmartClient.execute

Execute a GraphQL operation against the GigSmart API.

Handles authentication header injection, error classification, partial-success policy (queries warn; mutations raise), and concurrency limiting.

execute(document: str, variables: dict | None = None, *, operation_name: str | None = None, is_mutation: bool = False) -> dict

Parameter Type Default Description
document str The GraphQL query or mutation string.
variables dict | None None Optional dict of GraphQL variables.
operation_name str | None None Optional operation name hint (for logging).
is_mutation bool False When True, any errors in the response raise immediately (no partial-success tolerance).

Returns: dict — The data dict from the GraphQL response.

Raises:

  • GigSmartAuthError — On UNAUTHENTICATED or FORBIDDEN errors.
  • GigSmartValidationError — On BAD_USER_INPUT errors.
  • GigSmartNotFoundError — On NOT_FOUND errors.
  • GigSmartRateLimitError — On HTTP 429.
  • GigSmartTransportError — On HTTP 5xx or network failures.
  • GigSmartConflictError — On CONFLICT errors.
  • GigSmartGraphQLError — On any other GraphQL error.

Method GigSmartClient.paginate

Fetch all pages of a Relay connection and return all nodes.

paginate(document: str, variables: dict, extract_path: str, page_size: int = 25) -> list[dict]

Parameter Type Default Description
document str A GraphQL list query using Relay pagination.
variables dict Base variables dict (first and after will be injected / overwritten by this method).
extract_path str Dot-separated path from the data dict to the Relay connection field, e.g. "organization.gigs".
page_size int 25 Number of items to request per page.

Returns: list[dict] — A flat list of all node dicts across all pages.

Alias GigSmartConfig

Re-exported from parrot_tools.interfaces.gigsmart.config.GigSmartConfig.

Alias GigSmartConflictError

Re-exported from parrot_tools.interfaces.gigsmart.exceptions.GigSmartConflictError.

Alias GigSmartError

Re-exported from parrot_tools.interfaces.gigsmart.exceptions.GigSmartError.

Alias GigSmartGraphQLError

Re-exported from parrot_tools.interfaces.gigsmart.exceptions.GigSmartGraphQLError.

Alias GigSmartNotFoundError

Re-exported from parrot_tools.interfaces.gigsmart.exceptions.GigSmartNotFoundError.

Alias GigSmartRateLimitError

Re-exported from parrot_tools.interfaces.gigsmart.exceptions.GigSmartRateLimitError.

Alias GigSmartTransportError

Re-exported from parrot_tools.interfaces.gigsmart.exceptions.GigSmartTransportError.

Alias GigSmartValidationError

Re-exported from parrot_tools.interfaces.gigsmart.exceptions.GigSmartValidationError.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally