4.2 Remote Fields
In this lesson you'll learn how to add Remote Fields to your models.
This step of our Getting Started tutorial covers Remote Fields, one of our Content Federation features.
We use Remote Fields for data enrichment. You can add them to a model in your schema to fetch data from a Remote Source. This type of field connects remote data to a specific entry in that model, and it's always related to a single remote source & custom type.
To be able to add a Remote Field to a model in your Schema, you need to have configured a Remote Source first, so make sure you have followed the previous step of our tutorial before you start this one.
#The use case
A common use case is to use Remote Fields to facilitate e-commerce by consolidating product listings from multiple suppliers onto one platform. For the purposes of this tutorial, we will add a Remote Field to our Product model and use it to fetch review data from the
DEMO Hygraph API that we connected in our remote sources lesson, so it can be displayed on our front end.
#Adding a Remote Field
We're going to use the Remote Source that we configured in the previous lesson to add a Remote Field to our Product Model.
Let's go to our Schema, select the model, and then click on the
REST Remote Field option on the right sidebar.
We'll use the following information:
|Settings||API ID||Completing the display name will autocomplete the |
|Settings||Return type||Use the dropdown to select |
What we just did here is select one of the
This path will be added to our remote source base path to get a resulting endpoint.
Add to save.
Once you've added the Remote Field to the Product model, move on to our next lesson:4.3 Top-level Remote Fields