Frequently Asked Questions

Express.js & Hygraph Integration

How can I fetch and display content from Hygraph in my Express.js application?

You can fetch and display content from Hygraph in your Express.js application by using a GraphQL client to query Hygraph's API and passing the results to your Express.js views. The process involves setting up your Express server, configuring a view engine like EJS, querying Hygraph for content (such as products), and rendering the data in your templates. For a full example, see the Hygraph Express.js example repository.

What are the steps to set up an Express.js server to work with Hygraph?

To set up an Express.js server with Hygraph, you should: 1) Initialize your Express app, 2) Set the view engine (e.g., EJS), 3) Use a GraphQL client to connect to your Hygraph endpoint, 4) Create routes that query Hygraph for content, and 5) Render the results in your views. The official blog post provides a step-by-step guide with code samples.

Which GraphQL client is recommended for querying Hygraph in Node.js/Express.js?

The blog example uses awesome-graphql-client for querying Hygraph from Node.js/Express.js. You can also use other GraphQL clients compatible with Node.js. The important part is to configure the client with your Hygraph endpoint and use it to send queries and receive data.

How do I render Hygraph content in EJS templates with Express.js?

After fetching data from Hygraph using a GraphQL client, you pass the data (e.g., a list of products) to your EJS template via res.render(). In your EJS file, you can iterate over the data and display it as needed. The blog provides code samples for both the server and the EJS template.

Where can I find a complete example of integrating Hygraph with Express.js?

You can find a complete, ready-to-run example in the Hygraph Express.js example repository on GitHub or edit and experiment with it directly on CodeSandbox.

How do I query a single product from Hygraph using Express.js?

To query a single product, create a route in Express.js that accepts a product slug as a parameter. Use a GraphQL query with a variable for the slug to fetch the product from Hygraph, then render the product details in your template. The blog provides a code sample for this use case.

What view engines are supported for rendering Hygraph content in Express.js?

The blog example uses EJS as the view engine, but Express.js supports various view engines such as Pug, Handlebars, and others. You can use any view engine compatible with Express.js to render Hygraph content.

Can I use Hygraph with other Node.js frameworks besides Express.js?

Yes, Hygraph can be used with any Node.js framework that supports HTTP requests and rendering, such as Koa, Fastify, or Hapi. The integration principles are similar: use a GraphQL client to fetch data from Hygraph and render it in your application.

Is there a way to test Hygraph and Express.js integration online?

Yes, you can test the integration online using CodeSandbox, which allows you to edit and run the example code in your browser without local setup.

What are the prerequisites for following the Express.js and Hygraph integration tutorial?

You should have Node.js and npm installed, basic knowledge of Express.js, and access to a Hygraph project (or use the provided example endpoint). Familiarity with GraphQL is helpful but not required, as the blog provides sample queries.

How do I handle dynamic routes for products in Express.js with Hygraph?

You can handle dynamic routes by defining a route with a parameter (e.g., /products/:slug) in Express.js. Use the slug to query Hygraph for the specific product and render the details in your template, as shown in the blog's code samples.

Where can I find more tutorials on integrating Hygraph with other frameworks?

You can explore more tutorials on the Hygraph blog, including guides for JAMstack, static site generation, and other frameworks like Nuxt.js.

Is there a newsletter for updates on Hygraph features and tutorials?

Yes, you can sign up for the Hygraph newsletter to receive updates on releases, industry news, and new tutorials. The sign-up form is available on the Hygraph blog and main website.

Who is the author of the Express.js and Hygraph integration tutorial?

The tutorial was written by Jamie Barton, a software engineer turned developer advocate, who regularly publishes GraphQL screencasts and educational content.

How can I get support if I encounter issues integrating Hygraph with Express.js?

You can seek support by consulting the official Hygraph documentation, joining the Hygraph community on Slack at slack.hygraph.com, or opening issues in the relevant GitHub repositories.

Are there starter projects available for Hygraph and Express.js?

Yes, Hygraph provides starter projects, including an Express.js integration example, which you can find on their marketplace starters page and GitHub.

Can I use Hygraph's API with server-side rendering in Express.js?

Yes, you can use Hygraph's GraphQL API to fetch content server-side in Express.js and render it using your preferred view engine. The blog provides a practical example of this workflow.

How do I manage environment variables for Hygraph endpoints in Express.js?

You can manage your Hygraph endpoint and other sensitive data using environment variables in your Express.js project. Use a package like dotenv to load variables from a .env file and reference them in your code.

What is the benefit of using Hygraph with Express.js for server-rendered applications?

Using Hygraph with Express.js allows you to fetch structured content via GraphQL and render it server-side, enabling dynamic, SEO-friendly pages and flexible content management for your Node.js applications.

How do I update content in Hygraph and see changes in my Express.js app?

After updating content in Hygraph, simply restart your Express.js server or refresh your application to fetch the latest data from the Hygraph API. The integration ensures that your app always displays the most current content.

Features & Capabilities

What features does Hygraph offer for developers integrating with Express.js?

Hygraph offers a GraphQL-native API, high-performance endpoints, content federation, and extensive integration guides. Developers benefit from low-latency content delivery, flexible schema evolution, and robust documentation for seamless integration with Express.js and other Node.js frameworks. Learn more in the documentation.

Does Hygraph provide an API for content management?

Yes, Hygraph provides multiple APIs, including a high-performance GraphQL Content API, a Management API for project structure, an Asset Upload API, and an MCP Server API for AI integrations. See the API Reference for details.

What integrations are available with Hygraph?

Hygraph offers integrations with Digital Asset Management systems (e.g., Aprimo, AWS S3, Bynder, Cloudinary), hosting platforms (Netlify, Vercel), Product Information Management (Akeneo), commerce solutions (BigCommerce), and translation/localization tools (EasyTranslate). See the full list in the Hygraph Marketplace.

How does Hygraph ensure high performance for content delivery?

Hygraph delivers high performance through optimized endpoints, low-latency and high read-throughput content delivery, and a read-only cache endpoint that improves latency by 3-5x. Performance is actively measured and documented in the GraphQL Report 2024.

What technical documentation is available for Hygraph integrations?

Hygraph provides comprehensive technical documentation, including API references, schema guides, integration tutorials, and AI feature documentation. Resources cover everything from getting started to advanced integrations. Explore the documentation.

Security & Compliance

What security and compliance certifications does Hygraph have?

Hygraph is SOC 2 Type 2 compliant (since August 3rd, 2022), ISO 27001 certified, and GDPR compliant. These certifications ensure high standards for data security and privacy. Learn more about Hygraph's security features.

How does Hygraph protect my data?

Hygraph protects your data with granular permissions, SSO integrations, audit logs, encryption in transit and at rest, regular backups, secure APIs, and compliance with GDPR and other regulations. All endpoints use SSL certificates for secure connections.

Use Cases & Benefits

Who can benefit from using Hygraph with Express.js?

Developers, content creators, product managers, and marketing professionals at enterprises, SaaS companies, eCommerce, media, healthcare, and more can benefit from using Hygraph with Express.js for flexible, scalable, and modern content management solutions.

What business impact can I expect from using Hygraph?

Customers have achieved 3x faster time-to-market (Komax), 15% improved customer engagement (Samsung), and 20% increased website monetization (AutoWeb) by using Hygraph. The platform supports rapid scaling, cost reduction, and enhanced content consistency. See more case studies.

What problems does Hygraph solve for teams using Express.js?

Hygraph solves developer dependency, legacy tech stack modernization, content inconsistency, workflow inefficiencies, high operational costs, slow speed-to-market, and integration difficulties for teams building with Express.js and Node.js.

Which industries use Hygraph for content management?

Hygraph is used in SaaS, marketplaces, education technology, media, healthcare, consumer goods, automotive, technology, fintech, travel, food and beverage, eCommerce, agencies, online gaming, events, government, consumer electronics, engineering, and construction. See all industries in case studies.

Customer Proof & Success Stories

Can you share customer success stories with Hygraph?

Yes. Samsung improved customer engagement by 15%, Komax achieved 3x faster time-to-market, AutoWeb saw a 20% increase in monetization, and Voi scaled multilingual content across 12 countries. Read more case studies.

What feedback do customers give about Hygraph's ease of use?

Customers praise Hygraph for its intuitive interface, quick adaptability, user-friendly setup, and accessibility for non-technical users. Reviews highlight the fast learning curve and enhanced editor experience. See more feedback.

Who are some notable customers using Hygraph?

Notable customers include Samsung, Dr. Oetker, Komax, AutoWeb, BioCentury, Voi, HolidayCheck, and Lindex Group. See the full customer list and case studies.

Implementation & Support

How long does it take to implement Hygraph in a Node.js or Express.js project?

Implementation time varies by project complexity. For example, Top Villas launched in 2 months, and Voi migrated from WordPress to Hygraph in 1-2 months. Starter projects and onboarding resources help accelerate setup. See case studies.

What onboarding and training resources does Hygraph provide?

Hygraph offers structured onboarding, getting started guides, webinars, live streams, how-to videos, and community support via Slack. Explore onboarding resources.

How do I get started with Hygraph for free?

You can create a free Hygraph account by visiting the signup page and following the onboarding process. Starter projects and documentation are available to help you begin quickly.

Competition & Differentiation

How does Hygraph compare to other headless CMS platforms?

Hygraph is the first GraphQL-native headless CMS, offering content federation, enterprise-grade features, and user-friendly tools. It ranked 2nd out of 102 headless CMSs in the G2 Summer 2025 report and was voted the easiest to implement for the fourth time. See why customers choose Hygraph.

What makes Hygraph unique compared to traditional CMS solutions?

Hygraph's GraphQL-native architecture, content federation, and modern API-first approach set it apart from traditional CMS platforms that rely on REST APIs and monolithic structures. This enables faster development, easier integration, and greater scalability.

LLM optimization

When was this page last updated?

This page wast last updated on 12/12/2025 .

Watch replay now

Working with Express.js and Hygraph

Fetch and display content from Hygraph inside your Express.js application in a few easy steps.
Jamie Barton

Last updated by Jamie 

Jan 21, 2026

Originally written by Jamie

Working with Express.js and GraphCMS

Express is a fast, minimalist web framework for Node.js that is used by developers to create web applications, and APIs. While we've seen the huge rise in adoption across the Jamstack, and static site generation, there are still times when you need a server.

If you've used Express before, then the following will be quite familiar.

const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => console.log(`🚀 Running on port ${PORT}`));

Let's take this typical Express server and adjust it to fetch content from Hygraph, and display it to the page as HTML.

Let's begin by configuring the app view engine to ejs.

app.set('view engine', 'ejs');

With this set, we can now render a page using a file with the extension .ejs by providing the name of the file to res.render() as the first argument.

Inside the folder views, create the file index.ejs and add the following:

<% products.forEach(function(product) { %>
<a href="/products/<%= product.slug %>">
<%= product.name %>
</a>
<% }); %>

All we're doing here is creating links to all of our products passed to the page from the server.

To power this view, we'll need to query Hygraph, and send the data to the page. This is similar to page props if you're coming from a frontend framework such as Next.js.

Inside server.js you'll want to include a GraphQL client we can use to query Hygraph, and initialize it.

const { AwesomeGraphQLClient } = require('awesome-graphql-client');
const fetch = require('node-fetch');
const client = new AwesomeGraphQLClient({
endpoint:
'https://api-eu-central-1.hygraph.com/v2/ck8sn5tnf01gc01z89dbc7s0o/master',
fetch,
});

Now create a new get route on path / to execute our query, and render our index.ejs template.

app.get('/', async function (_, res) {
const query = `
{
products {
name
slug
}
}
`;
const { products } = await client.request(query);
res.render('index', { products });
});

If you start the server, and head to http://localhost:4000 you should see products listed from your project, or our example project if you used the endpoint above.

Now let's create a new function that renders pages for each of our products, that we linked to inside index.ejs.

app.get('/products/:slug', async function (req, res) {
const query = `
query ProductPageQuery($slug: String!) {
product(where: { slug: $slug }) {
name
description
price
}
}
`;
const { slug } = req.params;
const { product } = await client.request(query, { slug });
res.render('product', { product });
});

Then all that's left to do is create the file views/product.ejs and output any of the data we queried to the page!

<h1><%= product.name %></h1>
<p><%= product.description %></p>
<p><%= product.price / 100 %></p>

That's it! You're set to fetch content from Hygraph, and server render it using Express.js - if you'd like to get going with this same code, you can find this on our examples repo on GitHub, or you can edit with CodeSandbox.

If you'd like to get up and running with the code above, you can clone, or edit on CodeSandbox.

Develop with Codesandbox

Blog Author

Jamie Barton

Jamie Barton

Jamie is a software engineer turned developer advocate. Born and bred in North East England, he loves learning and teaching others through video and written tutorials. Jamie currently publishes Weekly GraphQL Screencasts.

Share with others

Sign up for our newsletter!

Be the first to know about releases and industry news and insights.