resolvedPackageData query fetches package data by its content-addressed ID. This is used with the normalized caching pattern to efficiently retrieve package data that may be shared across multiple content items.
Query
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | ID! | Yes | Content-addressed package ID (SHA-256 hash) |
Example
ResolvedPackageData Fields
| Field | Type | Description |
|---|---|---|
id | ID! | Content-addressed SHA-256 hash |
version | String! | Semantic version |
components | String | JSON object mapping component names to compiled code |
assets | String | JSON object mapping component names to asset arrays |
Usage Pattern
This query is typically used withresolvedRef for efficient caching:
Step 1: Fetch Content with References
Step 2: Check Cache and Fetch Missing Packages
Step 3: Load Content with Cached Packages
Benefits
- Smaller Payloads: Content responses only include package IDs, not full data
- Efficient Caching: Content-addressed IDs mean packages never change
- Shared Data: Multiple content items referencing the same package share cached data
- WebSocket Compliance: Subscription payloads stay under AWS 128KB limit
- Reduced Bandwidth: Only fetch packages once, regardless of how many content items use them
Draft Packages
Draft packages use a special ID format and should not be cached long-term:See the Caching documentation for a complete guide to implementing normalized package caching.
