Skip to main content
The GraphQL API supports normalized package caching to reduce payload sizes and enable efficient client-side caching.

How It Works

Package data is identified by content-addressed SHA-256 hashes. This means:
  • The same package content always has the same ID
  • Multiple content items can share the same package data
  • Packages can be cached indefinitely (they’re immutable)
  • Subscription payloads stay under AWS 100KB WebSocket limit

Two Resolution Approaches

Full Resolution (resolvedPackage)

Use resolvedPackage when you need all package data in a single request:

Reference Resolution (resolvedRef)

Use resolvedRef for optimal caching and smaller payloads:
Response:

Fetching Package Data

Query package data by ID (only if not cached):
Response:

Client Implementation

Caching Strategy

Handling Content with Caching

Subscription Handler with Caching

Draft Package Handling

Draft packages use a special ID format: draft:{projectId}:{organizationId}

Benefits

  1. Smaller Payloads: Subscription updates only include IDs, not full package data
  2. Efficient Caching: Content-addressed IDs mean packages never change
  3. Shared Data: Multiple content items referencing the same package share cached data
  4. WebSocket Compliance: Payloads stay under AWS 100KB limit
  5. Reduced Bandwidth: Only fetch packages once, regardless of how many content items use them