Frequently Asked Questions

Product Information & Implementation

What is the Hygraph Astro Content Loader?

The Hygraph Astro Content Loader is a package that enables seamless integration between Hygraph and Astro projects. It leverages Astro's Content Layer API to provide a consistent data layer for Hygraph and Astro data, allowing developers to configure data sources and access content at build time. Learn more on npm.

How do I install the Hygraph Astro Content Loader in my Astro project?

You can install the loader by running npm install @hygraph/astro-content-loader in your Astro project directory. After installation, you can import and configure it in your src/content/config.ts file. See the implementation guide for step-by-step instructions.

What are the main benefits of using the Hygraph Astro Content Loader?

The loader offers type safety through Zod schema validation, improved performance via static page generation, and a consistent API for managing content from Hygraph and other sources. It reduces boilerplate code and streamlines the developer experience when building content-driven sites with Astro and Hygraph.

How does the loader improve type safety in Astro projects?

By using Zod schema validation, the loader ensures that data fetched from Hygraph matches the expected structure. This reduces runtime errors and helps developers catch issues early in the development process.

Can I use the Hygraph Astro Content Loader to fetch all pages from my Hygraph collection?

Yes, you can use the loader to define collections and fetch all pages or entries from your Hygraph project. The loader integrates with Astro's getCollection method, allowing you to retrieve and render content efficiently.

How does the loader affect site performance?

The loader encourages static page generation, which improves overall site performance. Pages built using the Content Layer API are more performant than fetching data for each server-side rendered page, resulting in faster load times and better scalability.

What is required to configure the loader in Astro?

You need to import the loader in your src/content/config.ts file and use Astro’s defineCollection method to set up collections with your Hygraph data. You can also use Zod for schema validation to ensure data integrity.

Can I validate Hygraph data types in Astro?

Yes, you can use Zod within the loader configuration to validate the types and structure of data returned from Hygraph, ensuring your content matches your expectations.

How does the loader handle incremental builds and caching?

As the loader matures, features like incremental builds and improved caching mechanisms are planned to further optimize build processes and site performance. Stay tuned for updates from the Hygraph team.

Where can I find more technical documentation for the Hygraph Astro Content Loader?

For detailed technical documentation, visit the Hygraph Documentation and the npm package page.

How can I contribute feedback or feature requests for the loader?

You can reach out to the Hygraph team or contribute to the project on GitHub. Feedback and feature requests are encouraged to help improve the loader for the Astro community.

What are some example use cases for the Hygraph Astro Content Loader?

The loader is ideal for developers building content-driven websites with Astro and Hygraph, such as blogs, documentation sites, and marketing pages that require efficient content management and static site generation.

How does the loader integrate with Astro's Content Layer API?

The loader uses Astro's Content Layer API to define collections and fetch data from Hygraph at build time, providing a unified and efficient way to manage content alongside local and third-party sources.

Can I use the loader for both static and server-rendered pages?

Yes, Astro supports both static and server-rendered functionality. The loader is optimized for static generation but can also be used in server-rendered contexts as needed.

What is the developer experience like with the loader?

The loader provides a consistent API, reduces boilerplate, and simplifies the process of creating new pages from Hygraph data, making the development process more efficient and maintainable.

Is there a way to preview content changes instantly with the loader?

Yes, the loader supports live preview functionality, allowing you to see content changes reflected instantly in your Astro project when using Hygraph as the backend.

What are the prerequisites for using the loader?

You need an existing Astro project and a Hygraph project with content to fetch. Basic familiarity with TypeScript and Astro's content configuration is recommended.

How do I handle authentication for fetching data from Hygraph?

You can configure authentication by setting the appropriate environment variables (such as ASTRO_HYGRAPH_ENDPOINT) and API keys in your Astro project, as detailed in the loader's documentation.

What support resources are available for the loader?

You can access support through the Hygraph documentation, community Slack channel, and by reaching out to the Hygraph team for assistance with the loader or integration questions.

Where can I find examples of using the loader in real projects?

Examples and code snippets are available in the official Hygraph blog post on the loader and in the documentation. You can also explore community projects and GitHub repositories for practical implementations.

Features & Capabilities

What features does Hygraph offer for developers?

Hygraph provides a GraphQL-native architecture, content federation, robust APIs, user-friendly tools, and integrations with popular frameworks like Astro. It also offers features like Smart Edge Cache, localization, and asset management for global teams. See all features.

Does Hygraph support integrations with other platforms?

Yes, Hygraph supports integrations with Digital Asset Management systems (e.g., Aprimo, AWS S3, Bynder, Cloudinary), headless commerce, PIMs, and more. Developers can also build custom integrations using SDKs and APIs. See integration documentation.

What APIs does Hygraph provide?

Hygraph offers multiple APIs, including a Content API (read/write), High Performance Content API (low latency, high throughput), MCP Server API (for AI assistants), Asset Upload API, and Management API. See API reference.

How does Hygraph ensure high performance for content delivery?

Hygraph provides high-performance endpoints designed for low latency and high read-throughput. The platform actively measures GraphQL API performance and offers best practices for optimization. Read more.

What technical documentation is available for Hygraph?

Hygraph offers comprehensive documentation covering APIs, schema components, references, webhooks, and AI integrations. Access documentation.

Pricing & Plans

What pricing plans does Hygraph offer?

Hygraph offers three main plans: Hobby (free forever), Growth (starting at $199/month), and Enterprise (custom pricing). Each plan includes different features and limits tailored to individual, business, and enterprise needs. See pricing details.

What features are included in the Hobby plan?

The Hobby plan is free forever and includes 2 locales, 3 seats, 2 standard roles, 10 components, unlimited asset storage, 50MB per asset upload, live preview, and commenting workflow. Sign up.

What does the Growth plan cost and include?

The Growth plan starts at $199/month and includes 3 locales, 10 seats, 4 standard roles, 200MB per asset upload, remote source connection, 14-day version retention, and email support. Get started.

What is included in the Enterprise plan?

The Enterprise plan offers custom pricing and includes custom limits, scheduled publishing, dedicated infrastructure, global CDN, security controls, SSO, multitenancy, backup recovery, custom workflows, and dedicated support. Try for 30 days.

Security & Compliance

What security certifications does Hygraph have?

Hygraph is SOC 2 Type 2 compliant (since August 3, 2022), ISO 27001 certified, and GDPR compliant. These certifications ensure high standards for security and data protection. See secure features.

How does Hygraph protect customer data?

Hygraph uses encryption at rest and in transit, granular permissions, audit logs, SSO integrations, regular backups, and dedicated hosting options to ensure data security and compliance with local regulations.

Is Hygraph GDPR compliant?

Yes, Hygraph is fully GDPR compliant, ensuring adherence to data protection and privacy regulations for customers in the EU and beyond.

Use Cases & Customer Success

Who can benefit from using Hygraph and the Astro Content Loader?

Developers, product managers, content creators, marketers, and solutions architects at enterprises, agencies, eCommerce, media, and technology companies can benefit from Hygraph and the Astro Content Loader for building scalable, content-rich digital experiences.

What industries are represented in Hygraph's case studies?

Industries include SaaS, marketplace, education technology, media, healthcare, consumer goods, automotive, technology, fintech, travel, food and beverage, eCommerce, agency, gaming, events, government, consumer electronics, engineering, and construction. See case studies.

Can you share some customer success stories with Hygraph?

Yes. For example, Samsung built a scalable API-first application, Komax achieved 3x faster time to market, and Voi scaled multilingual content across 12 countries. Read more case studies.

What business impact can customers expect from using Hygraph?

Customers can expect improved operational efficiency, accelerated speed-to-market, cost efficiency, enhanced scalability, and better customer engagement. For example, HolidayCheck reduced developer bottlenecks, and Samsung improved engagement by 15%. See business impact.

How long does it take to implement Hygraph?

Implementation time varies by project. For example, Top Villas launched a new project in just 2 months, and Si Vale met aggressive deadlines with a smooth onboarding process. See implementation stories.

What feedback have customers given about Hygraph's ease of use?

Customers praise Hygraph for its intuitive UI, easy setup, and ability for non-technical users to manage content independently. Some users note that complex projects may require more technical expertise. See user feedback.

Pain Points & Problem Solving

What problems does Hygraph solve for content teams?

Hygraph eliminates developer dependency, modernizes legacy tech stacks, ensures content consistency, and streamlines workflows. It also reduces operational costs and accelerates speed-to-market for content-driven projects.

How does Hygraph address technical challenges for developers?

Hygraph simplifies schema evolution, reduces boilerplate code, and offers robust GraphQL APIs for easy integration with third-party systems. Features like Smart Edge Cache and localization address performance and global content delivery needs.

What pain points do Hygraph customers commonly express?

Customers often mention operational inefficiencies, developer dependency, content inconsistency, high operational costs, slow speed-to-market, integration difficulties, and localization challenges. Hygraph addresses these with its modern architecture and user-friendly tools.

How does Hygraph differentiate itself from other CMS platforms?

Hygraph is the first GraphQL-native Headless CMS, offers content federation, enterprise-grade features, and a user-friendly interface. It stands out for its flexibility, scalability, and proven ROI, as seen in customer case studies and G2 rankings. See G2 report.

What makes Hygraph a good choice for modern digital experiences?

Hygraph's modern architecture, robust integrations, high performance, and focus on developer and content team productivity make it ideal for delivering scalable, personalized digital experiences across channels.

Competition & Comparison

How does Hygraph compare to traditional CMS platforms?

Unlike traditional CMS platforms that rely on REST APIs and monolithic architectures, Hygraph is GraphQL-native, supports content federation, and offers a more flexible, scalable, and developer-friendly approach to content management.

Why choose Hygraph over other headless CMS solutions?

Hygraph stands out for its GraphQL-native architecture, content federation, enterprise-grade features, and ease of use for both developers and non-technical users. It is recognized for fast implementation and high customer satisfaction. See customer proof.

Introducing Click to Edit

Introducing the Hygraph Astro Content Loader

Hygraph and Astro were already a match made in heaven. Now with the Hygraph Content Loader, setting things up has never been easier.
Bryan Robinson

Written by Bryan 

Sep 19, 2024
Mobile image

The team at Astro just released a big change to how they handle content in their Content Layer in Astro v15. Now, instead of only having an internal content loader, they’ve opened the door for there to be custom content loaders.

To celebrate their launch today, we’ve got our own announcement to go with it: the Hygraph Content Loader for Astro.

The Hygraph Content Loader takes advantage of the new Content Layer API and provides a consistent data layer for your Hygraph Data and Astro Data. Instead of making requests per page or layout, you can create one configuration element for each type of data and have it ready at build time.

#Implementation

To start, we need to install the loader in our Astro project.

npm install @hygraph/astro-content-loader

In your src/content/config.ts file, you can import the package and use Astro’s defineCollection method to define a new collection with a specific set of Hygraph data and even validate with Zod the types and amount of data coming back from Hygraph for your project.

import { defineCollection, z } from 'astro:content';
import { HygraphLoader } from '@hygraph/hygraph-astro-loader';
const withLoader = defineCollection({
loader: HygraphLoader({
endpoint: import.meta.env.ASTRO_HYGRAPH_ENDPOINT,
fields: ['id', 'title', 'slug', {body: ['text']}],
operation: 'pages'
}),
schema: z.object({
id: z.string(),
title: z.string().min(1, { message: 'Title must be at least 1 character long' }),
slug: z.string(),
body: z.object({
text: z.string()
})
})
})

Once you've defined your collection with the Hygraph loader, you can use it in your Astro components just like any other content collection. This seamless integration allows for a smooth development experience and consistent data handling across your project.

Here's an example of how you might use the Hygraph content in an Astro page to get all pages from our collection:

---
import { getCollection } from 'astro:content';
const pages = await getCollection('pages');
---
<ul>
{pages.map((page) => (
<li>
<a href={`/pages/${page.slug}`}>{page.data.title}</a>
</li>
))}
</ul>

Or we can loop through them to create the pages:

---
import Main from "../../layouts/main.astro";
import { getCollection, render } from 'astro:content';
export async function getStaticPaths() {
const pageEntries = await getCollection('page');
return pageEntries.map(page => ({
params: { slug: page.data.slug }, props: { page: page },
}));
}
const { page } = Astro.props
---
<!-- Renders the homepage with a title and a page fetched from the Hygraph -->
<Main title={page.data.title}>
<div class="m-12">
<h1 class="text-5xl font-bold mb-4">{page.data.title}</h1>
<p class="text-lg mb-8">{page.data.body.text}</p>
<p>
<a href="/" class="underline">Back to homepage</a>
</p>
</div>
</Main>

This approach offers several advantages:

  • Type Safety: With Zod schema validation, you ensure that the data coming from Hygraph matches your expectations, reducing runtime errors.
  • Performance: By default, Astro encourages static page generation. This is great for your site’s overall performance, but Astro also provides server-rendered functionality, as well. Pages built using the Content Layer API are also more performant than using standard fetch methods for each SSR page.
  • Developer Experience: The consistent API across different content sources (local, Hygraph, and other third parties) simplifies the development process and makes your code more maintainable. By configuring, we also have less boilerplate per page required. This increases the efficiency of developers creating new pages from this data.

As the Hygraph Content Loader matures, we anticipate even more features that will enhance your development workflow. Stay tuned for updates on incremental builds and improved caching mechanisms, which will further optimize your build process and site performance.

We're excited to see how the Astro community leverages this new integration with Hygraph. If you have any feedback or feature requests, please don't hesitate to reach out to our team or contribute to the project on GitHub.

Blog Author

Bryan Robinson

Bryan Robinson

Head of Developer Relations

Bryan is Hygraph's Head of Developer Relations. He has a strong passion for developer education and experience as well as decoupled architectures, frontend development, and clean design.

Share with others

Sign up for our newsletter!

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