How do I add a custom remote source and field in Hygraph?
To add a custom remote source in Hygraph, navigate to the Schema builder and click +Add next to Remote Sources. Enter the required details such as Display Name, Prefix, Type (REST or GraphQL), and Base URL. For example, you can use https://www.federatethis.com/api as the base URL for mock APIs. After creating the remote source, add custom type definitions (e.g., Product, Products, ProductMeta) to define the data structure. Once the remote source is set up, you can add remote fields to your models, specifying the API path and return type. For a step-by-step video guide, see Adding API Data to a Headless CMS.
How do I configure a remote field in Hygraph?
After setting up your remote source, go to Schema > Query and add a top-level remote field. Specify the Display Name, API ID, Remote Source, Method (GET), Return Type (e.g., ProductMeta), and Path (e.g., /products). Click Add to create the remote field. You can then query this field in the API Playground to retrieve data from the remote source. For example, querying products { data { name price id } } will return product information from the external API.
Can I associate remote API data with my Hygraph models?
Yes, you can associate remote API data with Hygraph models by adding a remote field to your model and linking it via a unique identifier (e.g., API ID). For example, in a ProductPage model, you can add a field for API ID and a remote field for product data, using a path like /product/{{doc.apiId}}. This setup allows you to enrich your Hygraph content entries with external data, such as product details and reviews.
How do I add product reviews from a remote API to my Hygraph model?
To add product reviews from a remote API, define custom type definitions for reviews (e.g., Review, Reviews, ReviewMeta) in your remote source. Then, add a REST remote field to your ProductPage model with the appropriate path (e.g., /reviews/product/{{doc.apiId}}). This allows you to fetch and display reviews associated with each product entry in Hygraph. The API Playground can be used to test and retrieve review data.
Integration with E-commerce Platforms
How do I configure commercetools as a remote source in Hygraph?
To configure commercetools as a remote source, you need a commercetools account and project. In Hygraph, add a new remote source and select Commercetools as the type. Enter the Authorization URL, Scopes, Client ID, Client Secret, Display Name, Prefix, Type (GraphQL), and Base URL (formatted as https://<COMMERCETOOLS_API_URL>/<PROJECT_KEY>/graphql). Save the remote source to enable integration with commercetools data. For more details, see the documentation.
How do I configure Commercelayer as a remote source in Hygraph?
To configure Commercelayer, create a Commercelayer account and obtain credentials. In Hygraph, add a new remote source and select Commercelayer as the type. Enter the Authorization URL (base endpoint plus /oauth/token), Client ID, Display Name, Prefix, Type (REST), and Base URL. Save the remote source to connect Hygraph with Commercelayer data. For step-by-step instructions, refer to the documentation.
Working with Custom Input Types & API Queries
How do I use custom input types with remote fields in Hygraph?
Custom input types allow you to pass arguments to remote fields for more dynamic queries. For example, when integrating with the Github REST API, you can define a custom input type (e.g., githubInput with userId: String!) and use it in a remote field configuration. This enables you to query user details by passing the required input argument in your API Playground queries. For more details, see the documentation.
How can I fetch a product catalog from an external API using Hygraph?
You can fetch a product catalog from an external API by adding a remote field to your Product model. Define the remote source and field, then query the catalog using the API Playground. The response will include both Hygraph-managed data and external catalog data, allowing you to display enriched product pages. See the documentation for examples.
General Features & Capabilities
What are the key features of Hygraph for remote data integration?
Hygraph offers robust remote data integration features, including support for REST and GraphQL remote sources, custom type definitions, top-level and model-level remote fields, and dynamic input types. These capabilities enable you to federate data from multiple APIs, enrich your content models, and streamline workflows for complex digital experiences. For more advanced features, Hygraph also provides Smart Edge Cache, content federation, and granular permissions. Learn more at Hygraph Features.
How does Hygraph ensure security and compliance for remote data integrations?
Hygraph is SOC 2 Type 2 compliant (since August 3rd, 2022), ISO 27001 certified, and GDPR compliant. Security features include granular permissions, SSO integrations, audit logs, encryption at rest and in transit, and regular backups. Enterprise customers benefit from dedicated hosting, custom SLAs, and transparent reporting. For more details, see the security features page and security report.
Performance, Support & Onboarding
What performance benefits does Hygraph offer for remote data integrations?
Hygraph delivers high performance for content management and delivery through features like Smart Edge Cache, high-performance endpoints, and optimized GraphQL API usage. These enhancements ensure fast, reliable data delivery for global audiences and high-traffic applications. For more details, see the performance improvements blog post.
What support and onboarding resources are available for Hygraph users?
Hygraph provides 24/7 support via chat, email, and phone, as well as real-time troubleshooting through Intercom chat. Users can access extensive documentation, webinars, live streams, and how-to videos. Enterprise customers receive a dedicated Customer Success Manager and structured onboarding, including introduction calls, account provisioning, and technical/content kickoffs. Join the community Slack channel here and explore documentation at Hygraph Documentation.
Pricing & Plans
What is Hygraph's pricing model?
Hygraph offers a Free Forever Developer Account for developers to explore and build projects at no cost. Self-service plans include transparent monthly and annual pricing, such as the Growth Plan at $299/month or $199/month when billed annually. Custom enterprise pricing starts at $900/month for tailored solutions. Plans include 1,000 entries, with add-ons available for $25 per 5,000 additional entries and extra locales for $150 each. For full details, visit the Hygraph Pricing Page.
Use Cases & Customer Success
Who can benefit from using Hygraph?
Hygraph is ideal for developers, product managers, and marketing teams in industries such as ecommerce, automotive, technology, food and beverage, manufacturing, transportation, staffing, and science. It supports organizations seeking to modernize legacy tech stacks, scale content operations, and deliver global digital experiences. For more, see Hygraph Case Studies.
Can you share specific customer success stories using Hygraph?
Yes, Hygraph has helped companies achieve measurable results. For example, Komax managed over 20,000 product variations across 40+ markets and achieved 3x faster time to market (case study). Samsung improved customer engagement by 15% (case study). Stobag increased online revenue share from 15% to 70% (case study). For more, visit the Hygraph Case Studies Page.
Pain Points & Solutions
What problems does Hygraph solve for businesses?
Hygraph addresses operational inefficiencies (e.g., developer bottlenecks, legacy tech stack modernization), financial challenges (high maintenance costs, slow speed-to-market), and technical issues (schema evolution, integration difficulties, cache and localization problems). Its user-friendly interface, GraphQL-native architecture, and content federation help businesses streamline workflows and deliver modern digital experiences. See case studies for real-world examples.
Troubleshooting & Maintenance
How does Hygraph handle maintenance, upgrades, and troubleshooting?
Hygraph is a cloud-based platform that manages all deployment, updates, and infrastructure maintenance for you. Upgrades are seamlessly integrated, and troubleshooting is supported via 24/7 chat, email, phone, Intercom chat, and extensive documentation. Enterprise customers receive a dedicated Customer Success Manager for personalized support. For more, see Hygraph Documentation.
In this video, Bryan uses Federate this - our collection of mock APIs and information for federated data sources in GraphQL - to show you how to add data from a remote API to your Hygraph project step-by-step.
After configuring our remote source, go to Schema > Query and add a top-level remote field, which will allow us to connect our products list as data directly in our API.
To add your remote field, click on REST from the right sidebar and use the following information:
Field
Input
Display name
Products
API ID
products
Remote source
Third Party APIs is selected by default. Leave it as it is
Method
GET is selected by default. Leave it as it is
Return type
Use the dropdown to select ProductMeta
Path
/products
Click Add at the bottom of the screen to create your remote field.
Would you like to check if it works?
Go to the API Playground and try out the following query:
Query
Response
If you run the query, it should return information on three sample products.
If we wanted to bring specific information into a Product model, we'd have to add a Remote Field into that model.
If you do not have a Product model yet, you can go to your Schema and click + Add next to Models and use the following information to create it:
Field
Input
Display name
ProductPage
API ID
productPage
Plural API ID
productsPages
Let's also add some fields to this model. We won't be adding price or any other information that is otherwise in out API. We will only add fields that we want to add to our data and that Editors will be able to work with.
We'll start with a single line text field that we'll use as a title:
Field
Input
Display name
Title
API ID
title
Use as title field
Select this checkbox
We'll add a slug field:
Field
Input
Display name
Slug
API ID
slug
Lowercase
Leave this checkbox selected
We'll add a Rich Text field:
Field
Input
Display name
Body
API ID
body
We need to associate the data in this model with the data that's in our API, and for that we'll add another single line text field, using the following information:
Field
Input
Display name
API ID
API ID
apiId
At this point we're ready to add our remote field. We'll scroll down the right sidebar and add a REST field using the following information:
Field
Input
Display name
Product data
API ID
productData
Remote source
Third Party APIs is selected by default. Leave it as it is
Method
GET is selected by default. Leave it as it is
Return type
Use the dropdown to select ProductMeta
Path
/product/{{doc.apiId}}
Click Add to save your remote field.
Let's create an entry for our ProductPage model. Navigate to Content editor > ProductPage and click + Add entry.
We'll use the following information:
Field
Input
Title
Product 1 with extra data
Slug
product-1
Body
Use the dropdown tos elect Heading 2 and write "This is a headline".
API ID
This is where we will write the API ID of our product. IN this example we'll write "1".
We'll click Save & publish and go to the API Playground to test this.
Let's run the following query:
Query
Response
This query brings all the information we just added in to the content entry that we created, which comes from Hygraph's data, and also includes the productData data, which comes from the API and is associated through the API ID field we added earlier.
Now imagine you also want to add your product reviews here. Federate this has sample reviews that we can use to try this. We'll go back into the schema builder and edit our remote source by adding 3 new custom type definitions.
In our remote source, we'll click on + Add new custom type definition. We'll do this three times, to add the following types:
Review
Reviews
ReviewMeta
Don't forget to click Save at the top-right of your screen to update your remote source.
Next, we're going to add this to our ProductPage model as a REST remote field. To do this, navigate to Schema builder > ProductPage, select the REST field from the right sidebar, and use the following information:
Field
Input
Display name
Product Reviews
API ID
productReviews
Remote source
Third Party APIs is selected by default. Leave it as it is
Method
GET is selected by default. Leave it as it is
Return type
Use the dropdown to select ReviewtMeta
Path
/reviews/product/{{doc.apiId}}
Click Add to save your remote field.
The way we have set this up allows for the product details and the reviews from that product to pull from a single API ID, which we included in the API ID field that we added to our schema earlier and to which we assigned a value in the sample entry we created.
Now we can go back to the API Playground to test this using the following query:
Query
Response
The response now contains the 3 sample reviews that were included in Federate This.
Before we start, there is some data we will need from your commercetools account:
Go to Settings > Developer settings > API clients. Click + Create new API client to create one from scratch, give it a name and select the scopes you need for your project.
In our example we will select the Project scope under Manage. Click Create API client at the top-right of the screen.
The resulting screen contains the information you will need to configure your remote source. Save it for later, and let's continue with the process.
Navigate to the schema builder and click +Add next to Remote Sources. Use the following information to configure your remote source:
Field
Input
Remote source type
Select Commercetools
Authorization URL
This is the Auth URL in the API client details view of your commercetools account. Instead of copying it directly from there, copy the URL on the first line of the cURL below. Paste that in the Authorization URL field of your Hygraph Remote Source.
Scopes
This is the Scope in the API client details view of your commercetools account. Copy it and paste it in Hygraph, then click + Add scope to add.
Client ID
This is the client_id key in the API client details view of your commercetools account. Copy it and paste it in Hygraph. This is like a username.
Client Secret
This is the secret key in the API client details view of your commercetools account. Copy it and paste it in Hygraph. This is like a password.
Display name
This is the display name of your Remote Source, we will write "Commercetools" here.
Prefix
Completing the display name autocompletes the prefix, you can leave it as is.
Type
Select GraphQL
Base URL
To form the base URL, you will use the API URL and the project_key from the API client details view of your commercetools account, like this: https://<COMMERCETOOLS_API_URL>/<PROJECT_KEY>/graphql.
Click Add Remote Source at the bottom of the screen to save your Remote Source.
Navigate to the schema builder and click +Add next to Remote Sources. Use the following information to configure your remote source:
Field
Input
Remote source type
Select Commercelayer
Authorization URL
Copy the Base endpoint in your Commercelayer credentials screen, paste it in Hygraph, and add /oauth/token at the end, like this: https://<YOUR_BASE_ENDPOINT>/oauth/token.
Scopes
We won't add anything here for this example.
Client ID
Copy the Client ID in your Commercelayer credentials screen and paste it here.
Client Secret
We won't add anything here for this example.
Display name
This is the display name of your Remote Source, we will write "Commercelayer" here.
Prefix
Completing the display name autocompletes the prefix, you can leave it as is.
Type
Select REST
Base URL
Copy the Base endpoint in your Commercelayer credentials screen and paste it here.
Click Add Remote Source at the bottom of the screen to save your Remote Source.
In this example, we will see how we can define and use a custom input type on a Remote Field. We will be using the Github REST API, specifically the usersendpoint.
We'll first add the Github API as a Remote Source and configure the right custom (input) types.
Set up a new remote source. If you don't know how to do this, please check out our documentation, using [https://api.github.com](https://api.github.com) as the base URL, then add a custom type with the following SDL:
typeUser{
avatar_url:String
bio:String
blog:String
company:String
created_at:DateTime
email:String
events_url:String
followers:Int
followers_url:String
following:Int
following_url:String
gists_url:String
gravatar_id:String
hireable:Boolean
html_url:String
id:Int
location:String
login:String
name:String
node_id:String
organizations_url:String
public_gists:Int
public_repos:Int
received_events_url:String
repos_url:String
site_admin:Boolean
starred_url:String
subscriptions_url:String
twitter_username:String
type:String
updated_at:DateTime
url:String
}
Also add a custom input type with the following SDL:
In an appropriate model, set up a REST Remote Field. In this example, we will use a model called Author and set up the Remote Field with apiId githubUserDetails. In the Remote Field config, add an input argument and select the input type to be the previously created githubInput. In the example, we will use the auto-generated API ID githubInput for the input arguments. We'll also set the field to be required since we will make the path depend on the input value.
Example - Input argument
Now configure the Remote Field's path to use the input argument. You can use the autocomplete feature in the handlebars notation for this.
Make sure there is at least one entry for the selected model, and then head over to the API Playground. The input argument can now be used in a query in the following way:
Please note that since we've made the userId parameter required in the custom input type (by adding a ! at the end), there will be an error if we don't supply the value properly.
This example shows a product content entry that fetches the product catalog from a Remote Source.
Besides the data that lives in Hygraph inside a regular model called Product - Product name, product description, etc - you can fetch a product catalog from an external API through a remote source that you added to the Product model as a Remote Field.
Remote Field example
Requests will return information in Hygraph - Product model - as well as information in the Remote Source, called myCatalogue in our Product model for this example.
Query
Response
The frontend could then use this information received through the Hygraph Content API to display the product page enriched with the product catalog.
This example uses Top-level Remote Fields to show us a product information content entry that fetches the product catalogue from an external API, unrelated to Hygraph.
Besides the data that lives in Hygraph inside a regular model called Product information - Slug, Title, Description - you can fetch a product catalogue from an external API through a Remote Source that you add to the Query model as a Remote Field.
Top-level Remote Field example
Requests will return information in Hygraph - Product model- as well as information in the Remote Source, called fieldremoteproduct in our Query model for this example.
Query
Response
The frontend could then use this information received through the Hygraph Content API to display the product page along with a product catalogue sourced from an external API.
This video tutorial covers adding a remote source to Hygraph and creating Top-Level Remote Fields to pull in data from the external e-commerce platform, BigCommerce.