What do I need to use the Product Page with Remote Source recipe in Hygraph?
To use the Product Page with Remote Source recipe, you need a Hygraph account and an active project. If you are on the Hobby (free) plan, you must use the 30-day trial or upgrade to a paid plan to access the Remote Sources feature. For more details, see the Hygraph pricing page.
Can I use Remote Sources on the Hygraph Hobby (free) plan?
No, the Remote Sources feature is not available on the Hobby (free) plan. To use Remote Sources, you need to be on a paid plan or activate the 30-day trial. This ensures you can follow the full tutorial and leverage content federation capabilities.
How do I get started with the Product Page with Remote Source recipe?
You can start by creating a new Hygraph project or using an existing one (with the required plan). The recipe provides step-by-step instructions, including configuring a remote source, installing the Remote Source Data Picker app, creating top-level remote fields, and building the product model. For a hands-on walkthrough, you can also watch the Hygraph Recipes - Product page with a Remote Source video.
Features & Capabilities
What is the Remote Sources feature in Hygraph?
The Remote Sources feature in Hygraph allows you to connect your schema to external third-party web services (such as a Product Information Management system) and fetch data directly into your content models. This enables content federation, so you can deliver both CMS and external product information to your frontend with a single API call, reducing duplication and the risk of inconsistencies.
How does the Remote Source Data Picker app work?
The Remote Source Data Picker app enables editors to select product data from a connected remote source using a dropdown menu in the content form. This streamlines the process of linking external product information to your Hygraph content entries, making it user-friendly for non-technical users.
What are Remote Fields and Top-level Remote Fields in Hygraph?
Remote Fields are fields inside a Hygraph model that connect specific remote data to an entry of that model, always related to a single remote source and custom type. Top-level Remote Fields are added to the Query system model and fetch remote data outside the context of a regular model, allowing you to send both Hygraph and remote data to your frontend in a single API call. This is a key part of Hygraph's content federation utility.
How does Hygraph help prevent data duplication and inconsistencies when integrating with external PIMs?
By using Remote Sources and content federation, Hygraph allows you to fetch product information directly from your external PIM without duplicating it in the CMS. This ensures that updates in the PIM are reflected in your frontend automatically, reducing the risk of errors and discrepancies between systems.
What fields are typically included in a Product Page model using Remote Sources?
A typical Product Page model using Remote Sources includes fields such as product name (required), product title, slug (with uniqueness and pattern validation), promotional image (asset picker), a remote field for product data, a data picker app field, and a reference field for related products. This setup allows editors to combine external product data with custom promotional content and related product links.
Technical Requirements & Implementation
What are the steps to set up a Product Page with Remote Source in Hygraph?
The main steps are: 1) Configure the remote source in your Hygraph project, 2) Install the Remote Source Data Picker app, 3) Create a top-level remote field in the Query system model, 4) Build the Product Page model with the necessary fields, and 5) Add a reference field for related products. Each step is detailed in the official guide and supported by a video tutorial.
How does the content form look for editors using this setup?
Editors will see a content form where they can select a product from the remote source using a dropdown menu, add custom promotional images, and link related products. This user-friendly interface streamlines the process of combining external product data with CMS-managed content.
Can I clone a ready-made Product Page cookbook instead of building from scratch?
Yes, if you want to explore how the Product Pages are built without following the step-by-step process, you can clone the entire Product Page Cookbook project. This allows you to compare recipes and see practical implementations.
Use Cases & Benefits
What are the main benefits of using Remote Sources for product pages in Hygraph?
Using Remote Sources for product pages allows you to: 1) Keep product information consistent and up-to-date by sourcing directly from your PIM, 2) Reduce manual data entry and the risk of errors, 3) Enable editors to combine external product data with custom promotional content, and 4) Deliver both CMS and external data to your frontend with a single API call, improving efficiency and performance.
Who can benefit from using the Product Page with Remote Source recipe?
This recipe is ideal for businesses that manage product information in a PIM and want to streamline content operations, reduce duplication, and empower editors to create rich product pages without technical complexity. It's especially useful for ecommerce, retail, and any organization needing to federate product data across multiple platforms.
Support & Resources
Where can I find more information or get help with Remote Sources in Hygraph?
You can find detailed guides on Remote data and References in the Hygraph documentation. For community support or to suggest new recipe ideas, join the Hygraph Community Slack.
Is there a video tutorial for setting up a Product Page with Remote Source?
What should I consider regarding plan limits when using Remote Sources?
Remote Sources are only available on paid Hygraph plans or during the 30-day trial. If you are adding this recipe to your own project, review your plan's limits to ensure you have access to all required features. For more details, visit the Hygraph pricing page.
This guide shows how to create a Product model in Hygraph that fetches product information from an external PIM via Remote Sources.
Companies often store their product information in a PIM, which helps them keep it consistent across different platforms. Using Hygraph's content Federation feature, Remote Sources, you can send CMS and product information to your frontend with a single API call.
Using this information directly from the PIM ensures you won't have to keep track of PIM information updates being replicated in the CMS, reducing the chance of error and discrepancies.
This mock image shows what a frontend using this setup could look like:
Product Page mock image
Remote Sources usage
Our Remote Sources feature is not available in Hobby plans (free). To follow this step-by-step tutorial you need to either have a paid plan, or use our 30-day trial.
Use this guide to create a Product Page model. You have two options:
OPTION 1:Create a project. This is the way to go if you want to follow the entire tutorial for learning purposes.
OPTION 2:Use an existing project of yours. This is the way to go if you already have a project and want to add this model. In this case, you may need to adjust parts of the tutorial to your own project schema. Remember that Hobby plan projects cannot use Remote Sources.
Take plan limits into consideration when adding a recipe to your own project.
This is the way to go if you're curious about how we built the Product Pages but don't want to follow the step-by-step creation process. This project contains the entire Product Page Cookbook so you can compare recipes or look into what instances they contain.
In this guide, you'll work with different schema elements to create a Product Page model. Let's look into them:
Model: Your schema is the content structure of your project. You can define your schema by creating models, adding fields, reusable components, and sidebar widgets, integrating remote sources, and establishing relationships with other models.
Remote source: A Remote Source is a custom resolver entry point for your schema that allows data to be sourced from an external third-party web service and accept field values from other Hygraph fields as arguments.
Remote Field: A field inside a regular Hygraph model that connects specific remote data to an entry of that model. Remote Fields are always related to a single remote source and custom type. RESTful remote fields are configured with a path to a specific endpoint in the remote source, such as user details from Github, or price & availability from Shopify.
Top Level Remote Field: A field inside the Query system model in Hygraph. These fields fetch remote data outside the context of a regular model, which is then sent to your frontend alongside your Hygraph data. This Content Federation utility eliminates the need to make separate API requests for data inside & outside of Hygraph.
References: References are relations between two or more content entries in your project. With references, you can reuse content entries by connecting them. Once the relation is configured, you can also create related content directly from the content form.
First, you need to configure a remote source to ensure that the project can use remote data fetched from your external PIM.
This guide will use the Federate this SKNCRE product routes to simulate an external PIM so you can follow the complete step-by-step process.
In your Hygraph project, navigate to the Schema builder and click +Add next to Remote Sources. Use the following information to configure the remote source:
This remote source will use the data stored in Federate This, using the Base URL you provided to send queries to. Since we created a GraphQL type remote source, there was no need to provide custom type definitions to define the structure of input arguments passed to your remote field later on.
The remote source itself is not enough to fetch information into a project. This project will use remote fields, top-level remote fields, and a data picker for remote fields app to create a product page that uses information from your external PIM without the need to duplicate it, while remaining easy to use for editors working with the UI.
Click here to install the Remote Source Data Picker app. This app gives your editors the ability to pick data from a Remote Source using a dropdown menu.
Top-level Remote Fields are added to the Query system model, and can fetch information into a project outside the context of a specific model. The picker app that we installed in the previous step needs both a Remote Field inside the Product model and a Top-level Remote Field to work.
To create a Top-level Remote Field, go to the Schema builder and access the Query system model. Since we created a GraphQL remote source, find the GraphQL field on the right sidebar and click Add on the field card. Use the following information:
Tab
Field
Input
Settings
Display name
Top level product
Settings
API ID
topLevelProduct
Settings
Remote Source
Use the dropdown menu to select Federate This SKNCRE.
Settings
Method
Use the dropdown menu to select POST.
Settings
Query
Select the products [Product!] checkbox.
Click Add to save.
Our product picker app will use this field to fetch product information from the external PIM.
Now that we have everything we need to build the model, let's move on to the final step.
To create the product model, navigate to the Schema builder and click +Add next to Models. Use the following information:
Field
Input
Display name
Product Page remote source
API ID
ProductPageRemoteSource
API ID Plural
ProductPageRemoteSources
Description
This product page model uses remote sources to fetch information from an external PIM
Click Add Model to save.
Now that the model has been created, you can start adding fields to it. As the product information lives outside of the CMS, this model does not need to have a large number of fields. Besides the remote fields and the picker, we will add a name, title, slug and asset picker, so editors can add alternative information. You can make your frontend take the alternative data when offered; that way editors can use the product information in the PIM not only for product listings but also for promotional content such as product special offers.
We will also add a reference field that will allow editors to link related products in the content form.
Let's start with the name. Add a Single line text field from the right sidebar, and use the following information:
Tab
Field
Input
Settings
Display name
Product name
Settings
API ID
productName
Settings
Use as title field
Leave this checkbox selected
Validations
Make field required
Select this checkbox
Click Add to save.
We want the name to be a required field because this field exists so that editors can identify products in the content table when relating content later on.
The other fields (title, slug and asset picker) will not be required, because this is additional information that editors may or may not add for the frontend to pick up.
Let's continue with the product title. Add a Single line text field from the right sidebar, and use the following information:
Tab
Field
Input
Settings
Display name
Product title
Settings
API ID
productTitle
Click Add to save.
Next, we'll add the slug. Add a Slug field from the right sidebar, and use the following information:
Tab
Field
Input
Settings
Display name
Slug
Settings
API ID
slug
Settings
Lowercase
Leave this checkbox selected
Validations
Set field as unique
Select this checkbox
Validations
Match a specific pattern
Select this checkbox, and then select Slug from the dropdown. You don't need to modify the pattern. Under Custom error message, write “Input value does not match the expected format.”
Click Add to save.
Next, you want editors to be able to include at least one image in the content form. Add an Asset picker field from the right sidebar, using the following information:
Tab
Field
Input
Settings
Display name
Promotional image
Settings
API ID
promotionalImage
Settings
Allow multiple assets
Select this checkbox
Click Add to save.
After installing the data picker app, 2 app fields became available to add to our models: One for GraphQL and one for REST. Since we configured a GraphQL Remote Source, we'll find the GraphQL Data Picker on the right sidebar and we'll click Add on the field card.
Use the following information:
Tab
Field
Input
Settings
Display name
Product picker RS
Settings
API ID
productPickerRs
Settings
Description
You can select a product here
Custom
ID Field ID
id
Custom
API ID
topLevelProduct
Custom
Title Field ID
name
Click Add to save.
Regarding the custom fields:
ID Field ID: This is the key the app uses to find what data to pick as the ID that gets used in the remote source field. We haven't added this remote field yet, we'll do it in the next step.
API ID: This is the API ID of the Top-level Remote Field that you configured earlier.
Title Field ID: This is the key from the data that shows the app what to display in the dropdown menu in the content form for editors to select.
The next thing we need to add to this model, is a Remote Field. Together with the Top-level Remote Field that you configured in the previous step, they will allow you to configure a field for the picker app that you installed earlier.
Find the GraphQL field on the right sidebar, and click Add. Use the following information:
Tab
Field
Input
Settings
Display name
Remote product data
Settings
API ID
remoteProductData
Settings
Remote Source
Use the dropdown menu to select Federate This SKNCRE.
Settings
Method
Use the dropdown menu to select POST.
Settings
Query
Select the product checkbox and the id argument checkboxunder it, then write {{doc.productPickerRs}} in the input field.
Advanced
Field visibility
Use the dropdown menu to select API only.
Click Add to save.
When configuring Settings > Query we selected id to match the ID Field ID from the data picker, and defined it as {{doc.productPickerRs}} so it uses the data picker app field.
As this field is only necessary to configure the remote data picker correctly, we selected the visibility to be API only, so editors cannot see it in the content form.
Finally we'll add a Reference field so that editors have the possibility to link related products. Use the following information:
Tab
Field
Input
Define
Allow only one model to be referenced
Select this radio button.
Define
Model to reference
use the dropdown to select Product Page remote source
This reference configuration will allow editors to add links to multiple content entries, but only from the same model.
If you want editors to select entries from more than one model, you should configure the reference to Allow multiple models to be referenced.
If you want your editors to add more than one entry from each model, you will need to select all the Allow multiple checkboxes as well.
This is how you build a Product model that uses Remote Sources to fetch data from an external PIM. The way we built it is user-friendly for editors, who will be able to select product data using a dropdown menu in the content form.