Core Architectural Mandate: In a modern multi-experience Clean Core landscape, frontend applications (React, Next.js, mobile apps, customer portals) should never be tightly coupled to disparate SAP OData endpoints and external SaaS APIs. A side-by-side Apollo Federation Gateway running on SAP BTP consolidates these services into a single unified Supergraph schema with field-level precision and zero core modification.
While SAP OData V4 is ideal for SAP Fiori Elements applications, external digital experience platforms suffer from severe architectural impedance:
| Architectural Attribute | Direct OData V4 Consumption | BTP Apollo Federation Gateway |
|---|---|---|
| Roundtrips per Screen | 5 - 15 sequential HTTP requests (Sales, Invoices, Partners, Tracking) | Single HTTP POST query |
| Payload Size | Heavy over-fetching (unwanted entity properties transferred across WAN) | Exact field-level precision (client specifies required keys) |
| Multi-Source Federation | Client manually aggregates SAP, Stripe, Salesforce, and ServiceNow | Unified declarative Supergraph resolved automatically by Gateway |
| Clean Core Boundary | Exposes internal S/4HANA OData endpoints directly to public Internet | Clean BTP side-by-side perimeter with OAuth2 token exchange |
In Apollo Federation v2, each bounded domain operates an independent Subgraph. The Apollo Router (deployed as a high-speed Rust container on SAP BTP Kyma or Cloud Foundry) merges these subgraphs into a single composition graph without runtime coordination:
// S/4HANA Order Subgraph Schema
extend schema @link(url: "https://specs.apollo.dev/federation/v2.0", import: ["@key"])
type SalesOrder @key(fields: "id") {
id: ID!
orderNumber: String!
netAmount: Float!
currency: String!
}
// Payment Subgraph Schema (Stripe/Adyen Bridge)
extend type SalesOrder @key(fields: "id") {
id: ID! @external
paymentTransaction: PaymentRecord
}
Explore complete architectural patterns for Apollo Federation, SAP BTP API Management, OAuth2 Principal Propagation, and Event-Driven Architecture in The SAP Enterprise Architecture Suite.
Get the Full Architecture Suite (FLASH80 - 80% Off) →When resolving nested relationships (e.g. fetching line items or customer master records for 50 sales orders), naive GraphQL resolvers execute 50 individual OData calls.
In Clean Core architecture, developers deploy DataLoader batches:
$filter=SalesOrder eq '1000' or SalesOrder eq '1001' query (or an OData $batch request).The BTP Apollo Federation Gateway acts as a secure identity broker:
SY-UNAME), enforcing standard RAP and DCL authorizations.@key(fields: "id")).