Skip to main content
The 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

ParameterTypeRequiredDescription
packageIdID!YesContent-addressed package ID (SHA-256 hash)

Example

Response:

ResolvedPackageData Fields

FieldTypeDescription
idID!Content-addressed SHA-256 hash
versionString!Semantic version
componentsString!JSON object mapping component names to compiled code
assetsString!JSON object mapping component names to asset arrays
cdnUrlStringCDN URL for fetching package data

Usage Pattern

This query is typically used with resolvedRef 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

  1. Smaller Payloads: Content responses only include package IDs, not full 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: Subscription payloads stay under 100KB limit
  5. 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.