CASE 03 / HEADLESS / CONTENT FRAGMENTS / GRAPHQL
Headless AEM: GraphQL and Sling Model Exporter Delivery Boundaries
Headless AEM is a choice of content contract, not simply a switch from HTML to JSON. This representative proof of concept compares Content Fragment GraphQL delivery with Sling Model Exporter and identifies what changes for frontend consumers, caching and editorial preview.
Engineering path
Engineering path
Proposed engineering sequence
- 01Authoring
- 02Content contract
- 03GraphQL / Exporter
- 04Delivery cache
- 05Consumer
01 / Context
Choose the API from the consumer’s content needs
- PLATFORM
- Content Fragments / GraphQL
- SCOPE
- Headless AEM delivery architecture
- TYPE
- Architecture exploration / proposed PoC
A consumer that needs reusable domain content has a different contract from one that needs page-component state. Define the required data and editorial workflow before selecting an endpoint.
02 / THE ENGINEERING PROBLEM
JSON endpoints do not automatically decouple presentation
Exporting page-shaped data can preserve a frontend dependency on the component tree. Conversely, a fully detached frontend must take ownership of routing, rendering and preview behavior that traditional AEM delivery may already provide.
03 / CONSTRAINTS
Boundaries the design must preserve
- Keep structured content and page-component export as distinct API contracts.
- Preserve publication visibility, null handling and consumer compatibility.
04 / ARCHITECTURE
Keep GraphQL and component export as distinct contracts
Content Fragment models provide structured content for GraphQL queries. Sling Model Exporter exposes model data as an exported representation. Treat these as separate APIs rather than describing the exporter as the GraphQL implementation.
System boundaries
Owns delivery contracts and consumer behavior; the content-modeling page owns schema design.
Headless AEM delivery architecture
- Authoring
- Content contract
- GraphQL / Exporter
- Delivery cache
- Consumer
05 / IMPLEMENTATION
Prove one content journey from authoring to consumption
Select a small, representative content model and consumer view. Persist the required GraphQL query, implement the consumer mapping and independently evaluate a component exporter where page context is needed.
Implementation checkpoints
Proposed engineering checks for this scenario.
- 01Specify required fields, null handling and reference behavior.
- 02Test published content separately from authenticated author access.
- 03Inspect the actual request method, URL and cache headers at the delivery edge.
06 / TECHNICAL DECISIONS
Use persisted queries for a controlled GraphQL delivery surface
Stored queries executed through a suitable GET delivery path can support Dispatcher and CDN caching. Cache configuration and publication behavior still need explicit validation; persistence alone is not a cache guarantee.
07 / TRADEOFFS
Independent frontends need independent operational ownership
Headless delivery can separate release cycles, but it adds consumer compatibility, preview and content-freshness decisions. Traditional rendering remains a reasonable choice when page composition and authoring control are the dominant requirements.
| Risk | Impact | Mitigation to validate |
|---|---|---|
| Model changes | Consumer assumptions break | Exercise old/new consumer fixtures and optional fields |
| Stale API response | Published changes are not visible | Test request identity and freshness at each cache layer |
Before stabilizing an API contract, review Content Fragment fields, references and schema evolution.
08 / VALIDATION
Test content changes against a real consumer contract
The proposed PoC should demonstrate behavior, not just an endpoint returning a successful status.
Acceptance scope and limits
TO VALIDATE
Proposed checks, not captured results.
- Test missing fields, empty references and unpublished dependencies.
- Compare cold and warm delivery and validate freshness after publication.
- Change a field in a test model and document the effect on the consumer.
DOES NOT CLAIM
Owns delivery contracts and consumer behavior; the content-modeling page owns schema design.
- A completed customer deployment or measured production outcome
- A passing test run without retained execution evidence
09 / FAILURE MODES
Failure modes to test before release
A persisted query can remain valid while a content-model change breaks a consumer's assumptions about null fields or cardinality. Exercise old and new consumers against representative content, then validate cache keys, publication invalidation and permission boundaries before promotion.
10 / LESSONS LEARNED
The delivery contract is the durable design decision
An API is useful when editors understand what they publish and consumers understand what can change. Keep detailed schema evolution in the content-modeling study and cache policy in the Dispatcher study.
Technical references
These sources document product behavior. The scenario and proposed validation are engineering interpretations, not vendor claims or execution evidence.