Our new top-level Federation capabilities allow you to connect multiple remote sources to Hygraph and query them directly through our API layer.
Rather than making multiple API calls to different systems, you can now fetch all content and data from a single Hygraph GraphQL endpoint.
Consider an e-commerce example, where you'd want to fetch product data from your commerce system (e.g. Shopify), digital assets from your DAM (e.g. Cloudinary), and rich content stored in Hygraph.
You can now fetch all of this data from Hygraph's content API, in one single query, for example:
query {shopifyProducts {titledescriptiontotalInventoryonlineStoreUrl}cloudinaryAssets {image {url}}blogArticles {titlebody}}
The benefits
- Simplification: Simplify your tech stack by having all frontend applications query data from one universal Hygraph API.
- Unification: Manage all your APIs in one place.
- GraphQL and typesafe: Even if the underlying APIs are REST, the final endpoint to query data from is GraphQL.
- Authentication and authorization: One API means a simpler process for authentication and authorization by frontend applications.
- Low-code approach: Hygraph eliminates the need to write and maintain middleware code to stitch multiple systems together.
- Content integrity: Eliminate duplicates and ensure that any changes are consistently reflected across all frontend applications the data is used at.
- Performance improvements: Querying content from a single API and Hygraph's advanced caching capabilities allow for more high-performance distribution of content.
#How are the new top-level capabilities different?
Model-level Remote Fields
We previously offered model-level content federation capabilities that allowed you to enrich existing content in Hygraph with more information from a remote API on a field level.
This meant that you needed to have a content entry in Hygraph with a unique identifier present (such as an ID) that is common across the two systems, which is then passed as an input argument to fetch additional information from the remote API.
For example, you could fetch price data from a commerce system using the unique SKU code for each product. However, the SKU code needs to be stored as part of an entry in Hygraph.
query {HygraphProduct {sku #unique identifier in both APIsShopifyRemoteSource {titledescriptiontotalInventoryonlineStoreUrl}}
New Top-level Remote Fields
While content enrichment is important, we understand that there might be other cases where you need to federate multiple APIs into one, while ensuring data ownership stays within the external system and not be mirrored into another system.
The new top-level federation capabilities help here by streamlining the process further, allowing you to directly fetch content from remote systems using one single Hygraph API, without the need to have corresponding content entries in Hygraph.
Read the documentationBoth of our content federation capabilities serve their own purpose, and in combination help you distribute content stored across multiple systems, to any destination of choice, without duplication.
The new top-level remote sources are available in all Hygraph plans, including the Community Tier.
Get started by going through our detailed documentation, or feel free to reach out to us to get a consultation on how remote fields can drastically decrease the complexity of your stack.
Blog Author