Frequently Asked Questions

Product Information & Implementation

What is the Hygraph Astro Content Loader?

The Hygraph Astro Content Loader is a package that integrates Hygraph with Astro's Content Layer API, providing a consistent data layer for both Hygraph and Astro data. It allows developers to configure content sources and have them ready at build time, streamlining the process of fetching and rendering content in Astro projects. Source

How do I install the Hygraph Astro Content Loader?

You can install the Hygraph Astro Content Loader in your Astro project using the following command: npm install @hygraph/astro-content-loader. The package is available on npm. Source

How does Hygraph integrate with Astro?

Hygraph integrates with Astro by using a GraphQL client to fetch data, which can then be rendered using Astro's components. The Hygraph Astro Content Loader leverages Astro's Content Layer API for efficient and type-safe content management. Source

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

Key benefits include type safety through Zod schema validation, improved performance via static page generation, and a consistent API across different content sources. This reduces runtime errors, enhances site performance, and simplifies development workflows by minimizing boilerplate code. Source

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

Comprehensive documentation for the Hygraph Astro Content Loader and other Hygraph features is available at Hygraph Documentation. Source

How can I lazy load content with Astro and Hygraph?

You can read a detailed guide on lazy loading content with Astro and Hygraph at this blog post. Source

Features & Capabilities

What features does Hygraph offer?

Hygraph provides a GraphQL-native architecture, content federation, scalability, and a wide range of integrations including hosting, eCommerce, localization, digital asset management, personalization, and AI. For a full list, visit Hygraph Features and Hygraph Integrations.

Does Hygraph provide an API?

Yes, Hygraph offers a powerful GraphQL API for efficient content fetching and management. Learn more at Hygraph API Reference.

What integrations are available with Hygraph?

Hygraph integrates with platforms such as Netlify, Vercel, BigCommerce, commercetools, Shopify, Lokalise, Crowdin, EasyTranslate, Smartling, Aprimo, AWS S3, Bynder, Cloudinary, Mux, Scaleflex Filerobot, Ninetailed, AltText.ai, Adminix, and Plasmic. For more details, visit Hygraph Integrations.

Pricing & Plans

What is Hygraph's pricing model?

Hygraph offers a free forever Hobby plan, a Growth plan starting at $199/month, and custom Enterprise plans. For more details, visit the pricing page.

Security & Compliance

What security and compliance certifications does Hygraph have?

Hygraph is SOC 2 Type 2 compliant, ISO 27001 certified, and GDPR compliant. It offers features such as SSO integrations, audit logs, encryption at rest and in transit, and sandbox environments. For more details, visit Hygraph Security Features.

Performance & Technical Requirements

How does Hygraph optimize content delivery performance?

Hygraph emphasizes rapid content distribution and responsiveness, which improves user experience, engagement, and search engine rankings. Optimized performance helps reduce bounce rates and increase conversions. For more details, visit this page.

Use Cases & Customer Success

Who can benefit from using Hygraph?

Hygraph is ideal for developers, IT decision-makers, content creators, project/program managers, agencies, solution partners, and technology partners. Companies that benefit include modern software companies, enterprises seeking to modernize, and brands aiming to scale across geographies or improve development velocity. Source

What industries are represented in Hygraph's case studies?

Hygraph's case studies span industries such as food and beverage, consumer electronics, automotive, healthcare, travel and hospitality, media and publishing, eCommerce, SaaS, marketplace, education technology, and wellness and fitness. For more details, visit Hygraph Case Studies.

Can you share specific customer success stories?

Yes. Komax achieved a 3X faster time to market, Autoweb saw a 20% increase in website monetization, Samsung improved customer engagement with a scalable platform, and Dr. Oetker enhanced their digital experience using MACH architecture. More stories are available at Hygraph Customer Stories.

Who are some of Hygraph's customers?

Notable customers include Sennheiser, Holidaycheck, Ancestry, Samsung, Dr. Oetker, Epic Games, Bandai Namco, Gamescom, Leo Vegas, and Clayton Homes. For more details and logos, visit Hygraph Case Studies.

Pain Points & Solutions

What problems does Hygraph solve?

Hygraph addresses operational pains (reliance on developers, outdated tech stacks, global team conflicts, clunky content creation), financial pains (high costs, slow speed-to-market, expensive maintenance, scalability challenges), and technical pains (boilerplate code, overwhelming queries, evolving schemas, cache and OpenID integration issues). For more details, visit Hygraph Product Page.

How does Hygraph solve pain points for different personas?

For developers, Hygraph reduces boilerplate code and streamlines query management. For content creators and project managers, it offers an intuitive interface for independent content updates. For business stakeholders, it lowers operational costs, supports scalability, and accelerates speed to market. Solutions are tailored to each persona's needs. Source

What KPIs and metrics are associated with the pain points Hygraph solves?

KPIs include time saved on content updates, system uptime, consistency across regions, user satisfaction scores, reduction in operational costs, time to market, maintenance costs, scalability metrics, and performance during peak usage. For more details, visit CMS KPIs Blog.

Support & Onboarding

What support is available for Hygraph users?

Hygraph provides 24/7 support via chat, email, and phone. Enterprise customers receive dedicated onboarding and expert guidance. All users have access to documentation, video tutorials, and a community Slack channel. For more details, visit Hygraph Contact Page.

How easy is it to get started with Hygraph?

Hygraph is designed for quick onboarding. Customers can sign up for a free-forever account and use resources like documentation and onboarding guides. For example, Top Villas launched a new project in just 2 months. Learn more at Hygraph Documentation.

What training and technical support does Hygraph offer?

Hygraph offers 24/7 support, onboarding sessions for enterprise customers, training resources such as video tutorials, documentation, webinars, and Customer Success Managers for expert guidance. For more details, visit Hygraph Contact Page.

Blog & Community

Where can I find the Hygraph blog?

The Hygraph Blog provides the latest updates, developer tutorials, and essential guides to content modeling. Visit the Hygraph Blog for news and insights.

Who authored the blog post 'Introducing the Hygraph Astro Content Loader'?

The blog post 'Introducing the Hygraph Astro Content Loader' was written by Bryan Robinson, Head of Developer Relations at Hygraph. Source

Webinar Event: How to Avoid Personalization Tech Traps

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.