SEARCH & AI / 009
GraphQL vs Sling Model Exporter for AI Ingestion
A comparison framework for selecting an AEM content API for AI ingestion, including schema stability, access boundaries and consumer coupling.
Topic map
Choose the extraction contract
AEM GraphQL AI ingestion
- 01Content model
- 02API shape
- 03Normalize
- 04Provenance
- 05Ingest
SYSTEM OVERVIEW
Two API contracts can feed one normalization boundary.
An illustrative comparison; the chosen endpoint and behavior must be checked against the target AEM implementation.
Content Fragment GraphQL
- Fragment model
- Explicit query
- Structured fields
Sling Model Exporter
- Resource / component
- Exported Sling Model
- Model JSON
Combined path
- Normalize source contract
- Validate provenance
- Ingestion
THIS ARTICLE EXPLORES
- Distinguish content-model APIs from component-oriented exports.
- Keep ingestion independent of presentation changes.
- Validate pagination, references and access behavior.
01 / PROBLEM
Choose the owner of the data shape.
A GraphQL contract can describe structured content independently of page composition. A model export reflects the model the application exposes. Either may be valid; the question is whether presentation changes should require ingestion changes.
| Concern | Content Fragment GraphQL | Sling Model Exporter |
|---|---|---|
| Source structure | Content Fragment Model fields. | Exported model properties. |
| Change ownership | Content model and query versioning. | Application model and serializer behavior. |
| Consumer fit | Structured content consumers. | Existing resource/component APIs. |
| Risk to test | Reference expansion and pagination. | Presentation coupling and missing provenance. |
02 / IMPLEMENTATION
Normalize into an application-owned document.
Avoid passing the raw response directly to a chunker. Map stable identity, locale, revision and permitted fields into a reviewed internal contract. The shapes below are deliberately simplified illustrations, not requests guaranteed to run against an arbitrary AEM instance.
Two source shapes; one normalization target
JSON / illustrative{
"graphqlLike": {
"data": {
"guideByPath": {
"item": {
"title": "Example guide",
"body": "Approved text"
}
}
}
},
"exporterLike": {
"title": "Example guide",
"body": "Approved text",
":type": "example/components/guide"
},
"normalized": {
"sourceId": "resolved-stable-id",
"locale": "en",
"revision": "resolved-revision",
"text": "Approved text"
}
}03 / INGESTION
An extraction endpoint is not a change feed.
Decide how initial enumeration, pagination and publication changes are detected. A cached query result can be suitable for content delivery without being a complete ingestion checkpoint. Confirm how unpublish and delete events become removal instructions.
Contract validation
Record endpoint behavior rather than assuming parity between APIs.
- 01Enumerate sources
- 02Read fields
- 03Resolve references
- 04Record revision
- 05Reconcile missing sources
04 / FAILURE MODES
Test schema and policy changes together.
A newly exported field can be syntactically valid and still be inappropriate for retrieval. Treat field selection as an allowlist. Do not broaden ingestion access merely to make a failed query succeed.
| Change | Failure | Validation |
|---|---|---|
| Field removed | Normalizer silently loses evidence. | Schema fixture fails explicitly. |
| Reference cycle | Expansion repeats or grows without bound. | Depth and visited-source limits. |
| Locale variant | Identity collision across languages. | Independent locale keys. |
| Source withdrawn | Cached data survives in search. | End-to-end removal test. |
05 / TRADEOFFS
Prefer the contract you can govern.
Reuse an existing export only when its stability and access boundaries fit the use case. Choose a structured-content API when it reduces coupling, not because GraphQL is inherently more suitable for AI.
Selection evidence
- A reviewed source-to-normalized mapping.
- Fixtures for absent fields and reference failures.
- Pagination and revision semantics documented.
- A tested deletion and permission-change path.
REFERENCE DESK
Sources & further verification
Product behavior should be checked against the target AEM and search-engine release. The design choices in this note are proposed assessment criteria, not vendor guarantees.