Skip to main content
Data structures and helpers for batched GraphQL mutations. These low-level primitives underlie the three-layer batch API:
  • client.execute_batch(operations) — executes a list of BatchOperations in a single aliased GraphQL request. Handles chunking (default 250 ops), aliasing, and partial-failure propagation. Returns a BatchResult.
  • store.save_batch(entities) — takes entity objects and builds the appropriate operations automatically, including any queued side-mutations.
  • store.save_all() — flushes every dirty or new entity the store is currently tracking.
For end-to-end usage patterns, see the Batched Mutations guide. Batched GraphQL mutation support. This module provides data structures and helpers for combining multiple GraphQL mutations into a single aliased document, reducing HTTP round-trips. Example

Classes

BatchOperation

A single operation within a batch request. Attributes:

Attributes

mutation_name
input_type_name
variables
return_fields
result
error

BatchResult

Result of a batch execution. Contains the full list of operations (in the same order they were submitted) with each operation’s .result and .error populated. Attributes:

Attributes

operations
raw_response
succeeded
Operations that completed successfully.
failed
Operations that encountered errors.
all_succeeded
True if every operation succeeded.

Functions

build_batch_document

Build an aliased GraphQL mutation document from a list of operations. Each operation gets a unique alias (op0, op1, …) and a unique variable name ($input0, $input1, …). Parameters: Returns: Example output for 2 operations