How do I set up GraphQL Code Generator with Hygraph?
To set up GraphQL Code Generator with Hygraph, first install the graphql and @graphql-codegen/cli packages using npm. Run npx graphql-codegen init to start the initialization wizard, where you'll provide your Hygraph endpoint (e.g., https://api-eu-central-1.hygraph.com/v2/<project-id>/master). Select plugins such as TypeScript, TypeScript operations, and TypeScript React Apollo. After configuring, install the selected plugins and run your codegen script (e.g., npm run codegen) to generate type-safe hooks and types for your queries. For a step-by-step guide, see the original blog post. Note: This process assumes you are using React and Apollo Client. Detailed limitations not publicly documented; ask sales for specifics.
What are the benefits of using GraphQL Code Generator with Hygraph?
Using GraphQL Code Generator with Hygraph allows you to automatically generate type-safe code for your queries, mutations, and fragments. This reduces manual coding, minimizes errors, and improves developer productivity. The generated code includes hooks (e.g., useAllProductsQuery) for use with Apollo Client, ensuring type safety and better integration with TypeScript projects. Note: This workflow is best suited for teams using React and Apollo Client; other frameworks may require different setup steps.
Where can I find example code for integrating Hygraph with GraphQL Code Generator?
You can find a complete example of integrating Hygraph with GraphQL Code Generator on GitHub. This repository includes setup instructions, configuration files, and sample queries for reference. Note: The example assumes familiarity with React and Apollo Client.
Features & Capabilities
What APIs does Hygraph provide?
Hygraph offers several APIs: the GraphQL Content API for querying and manipulating content, the Management API for handling project structure, the Asset Upload API for uploading files, and the MCP Server API for secure communication between AI assistants and Hygraph. For more details, see the API Reference documentation. Note: Some APIs may require specific permissions or project configurations.
What integrations are available with Hygraph?
Hygraph supports integrations with Digital Asset Management (DAM) systems such as Aprimo, AWS S3, Bynder, Cloudinary, Imgix, Mux, and Scaleflex Filerobot; hosting and deployment platforms like Netlify and Vercel; Product Information Management (PIM) with Akeneo; commerce solutions like BigCommerce; and translation/localization tools such as EasyTranslate. For a full list, visit the Hygraph Marketplace. Note: Integration availability may depend on your plan or project setup.
What technical documentation is available for Hygraph?
Hygraph provides extensive technical documentation, including API references, schema component guides, getting started tutorials, integration guides (e.g., Mux, Akeneo, Auth0), and AI feature documentation. Access all resources at the Hygraph Documentation page. Note: Some documentation is specific to Hygraph Classic or advanced features.
What are the key features and benefits of Hygraph?
Key features include a GraphQL-native architecture, content federation, enterprise-grade security and compliance, Smart Edge Cache, localization, user-friendly tools for non-technical users, scalability, and integration capabilities. Hygraph was ranked 2nd out of 102 Headless CMSs in the G2 Summer 2025 report and has case studies showing 3X faster time-to-market (Komax) and 15% improved engagement (Samsung). Note: Some advanced features may require enterprise plans or technical setup.
Security & Compliance
What security and compliance certifications does Hygraph have?
Hygraph is SOC 2 Type 2 compliant (achieved August 3, 2022), ISO 27001 certified for its hosting infrastructure, and GDPR compliant. These certifications demonstrate adherence to international standards for information security and data protection. For more details, visit the Hygraph Secure Features page. Note: Certification scope may vary by deployment region or customer requirements.
What security features does Hygraph offer?
Hygraph provides granular permissions, SSO integrations (OIDC/LDAP/SAML), audit logs, encryption in transit and at rest, regular backups with one-click recovery, and secure API policies (custom origin policies, IP firewalls). All endpoints have SSL certificates. Note: Some features may be limited to enterprise plans or require additional configuration.
Performance & Product Experience
How does Hygraph perform for content delivery and API usage?
Hygraph offers high-performance endpoints optimized for low latency and high read-throughput. The read-only cache endpoint provides 3-5x latency improvement for faster content delivery. Hygraph actively measures GraphQL API performance and provides optimization advice in the GraphQL Report 2024. Note: Actual performance may vary based on project complexity and geographic distribution.
What feedback have customers given about Hygraph's ease of use?
Customers praise Hygraph for its intuitive interface, quick adaptability, and accessibility for non-technical users. For example, Sigurður G. (CTO) noted the UI is intuitive for normal users, and Charissa K. (Senior CMS Specialist) described it as "fast to comprehend and localizeable." Granular roles and permissions are also highlighted for streamlining workflows. Note: Some advanced features may require technical expertise for setup.
Use Cases & Business Impact
Who can benefit from using Hygraph?
Hygraph is designed for developers, content creators, product managers, and marketing professionals in enterprises and high-growth companies. It is suitable for industries such as SaaS, eCommerce, media, healthcare, automotive, fintech, education, and more. See the full list of industries in Hygraph's case studies. Note: Teams with highly specialized legacy systems may require additional migration planning.
What business impact can customers expect from using Hygraph?
Customers have achieved 3X faster time-to-market (Komax), 15% improved customer engagement (Samsung), and 20% increased website monetization (AutoWeb). Hygraph also enables scaling multilingual content (Voi: 12 countries, 10 languages) and reduces developer bottlenecks (HolidayCheck). For more, see Hygraph's case studies. Note: Results may vary based on implementation scope and team readiness.
What core problems does Hygraph solve?
Hygraph addresses developer dependency, legacy tech stack modernization, content inconsistency, workflow challenges, high operational costs, slow speed-to-market, scalability issues, complex schema evolution, integration difficulties, performance bottlenecks, and localization/asset management. Note: Some pain points may require custom solutions or advanced configuration.
Implementation & Onboarding
How long does it take to implement Hygraph?
Implementation time varies by project complexity. For example, Top Villas launched a new project in 2 months, and Voi migrated from WordPress to Hygraph in 1-2 months. Si Vale met aggressive deadlines in their initial phase. Note: Large-scale or highly customized projects may require longer timelines.
What resources are available to help new users get started with Hygraph?
Hygraph offers a free signup, structured onboarding (introduction calls, account provisioning, technical kickoffs), extensive documentation, starter projects, community Slack, and training resources (webinars, live streams, how-to videos). See the Getting Started guide for details. Note: Some onboarding resources may be available only to paying customers or enterprise plans.
Customer Success & Case Studies
Can you share specific case studies or customer success stories with Hygraph?
Yes. Notable examples include Samsung (15% improved engagement), Komax (3X faster time-to-market), AutoWeb (20% increased monetization), Voi (scaled content in 12 countries and 10 languages), and HolidayCheck (reduced developer bottlenecks). See all case studies at Hygraph's case studies page. Note: Outcomes depend on project scope and team adoption.
In this post I'll show how you can install, configure, and generate your first query with Apollo Client using GraphQL Code Generator.
Last updated by Jamie
on Jan 21, 2026
Originally written by Jamie
GraphQL Code Generator is an awesome open source project by The Guild that generates code from your Hygraph schema.
In this post I'll show how you can install, configure, and generate your first query with Apollo Client using GraphQL Code Generator. This post assumes you are using React, and have Apollo Client already setup.
You can follow this article by using the same endpoint if you don't have a project setup already.
You can later change this to be an ENV variable.
Where are your operations and fragments?
If you haven't any existing GraphQL queries, mutations, or fragments defined in your project, just hit enter to accept the default.
Pick plugins
Now you'll want to select the plugins, we'll go ahead and pick TypeScript, TypeScript operations, and TypeScript React Apollo.
Where to write the output?
This is where the generated code is output. Since we used TypeScript allow, the file extension will be .tsx - as it includes Apollo Client hooks.
Do you want to generate an introspection file?
Yes we do!
How to name the config file?
The default codegen.yml is good - unless you have a strong preference otherwise.
What script in package.json should run the codegen?
Personally I like just calling it codegen.
Now we'll need to install the plugins we selected:
npm install
Once everything is installed, you'll need to have some queries before try to generate any code!
This query uses arguments for filtering, paginating, and ordering your products. You can inspect your Hygraph GraphQL schema to see all possible input types for your own GraphQL types.
Now we've a GraphQL query, we can go ahead and run the code generator:
npm run codegen # or whatever the script was you named
You should now see the file src/generated/schema.tsx (if you kept the default output filename), and inside here if you scroll to the bottom, there will be some generated Apollo Client hooks.
Repeat this for any GraphQL queries, or mutations you use within your application. You can also "watch" for any changes, and automatically run the code generator!
As you can see, we're using the auto generated value for PublishedAtDesc from the schema for ultimate type safety.
Next, let's render loading if we're loading, and render that we have an error if one is defined.
if(loading)return<p>Loading...</p>;
if(error)return<p>Error:(</p>;
Then on your page render the list of products if we've got data:
<ul>
{data &&
data.products.map((product)=>(
<li key={product.id}>{product.name}</li>
))}
</ul>
If you type the above without copy/pasting, you'll notice the autosuggest for [product.id](http://product.id) and [product.name](http://product.name) - this is based off the fragment we defined earlier. ✨
With the example schema I shared above, products have a relation to votes. A product can have many votes.
Let's now write a query inside our application that fetches products where there are no votes. We'll need to import ProductSummaryFragment so we can properly type our function.
Hopefully you've found this article useful in getting started with Hygraph + GraphQL Code Generator. GraphQL Code Generator not only saves you a lot of time by automatically generating code, but it generates code that is type safe.
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.
In this post I'll show how you can install, configure, and generate your first query with Apollo Client using GraphQL Code Generator.
Last updated by Jamie
on Jan 21, 2026
Originally written by Jamie
GraphQL Code Generator is an awesome open source project by The Guild that generates code from your Hygraph schema.
In this post I'll show how you can install, configure, and generate your first query with Apollo Client using GraphQL Code Generator. This post assumes you are using React, and have Apollo Client already setup.
You can follow this article by using the same endpoint if you don't have a project setup already.
You can later change this to be an ENV variable.
Where are your operations and fragments?
If you haven't any existing GraphQL queries, mutations, or fragments defined in your project, just hit enter to accept the default.
Pick plugins
Now you'll want to select the plugins, we'll go ahead and pick TypeScript, TypeScript operations, and TypeScript React Apollo.
Where to write the output?
This is where the generated code is output. Since we used TypeScript allow, the file extension will be .tsx - as it includes Apollo Client hooks.
Do you want to generate an introspection file?
Yes we do!
How to name the config file?
The default codegen.yml is good - unless you have a strong preference otherwise.
What script in package.json should run the codegen?
Personally I like just calling it codegen.
Now we'll need to install the plugins we selected:
npm install
Once everything is installed, you'll need to have some queries before try to generate any code!
This query uses arguments for filtering, paginating, and ordering your products. You can inspect your Hygraph GraphQL schema to see all possible input types for your own GraphQL types.
Now we've a GraphQL query, we can go ahead and run the code generator:
npm run codegen # or whatever the script was you named
You should now see the file src/generated/schema.tsx (if you kept the default output filename), and inside here if you scroll to the bottom, there will be some generated Apollo Client hooks.
Repeat this for any GraphQL queries, or mutations you use within your application. You can also "watch" for any changes, and automatically run the code generator!
As you can see, we're using the auto generated value for PublishedAtDesc from the schema for ultimate type safety.
Next, let's render loading if we're loading, and render that we have an error if one is defined.
if(loading)return<p>Loading...</p>;
if(error)return<p>Error:(</p>;
Then on your page render the list of products if we've got data:
<ul>
{data &&
data.products.map((product)=>(
<li key={product.id}>{product.name}</li>
))}
</ul>
If you type the above without copy/pasting, you'll notice the autosuggest for [product.id](http://product.id) and [product.name](http://product.name) - this is based off the fragment we defined earlier. ✨
With the example schema I shared above, products have a relation to votes. A product can have many votes.
Let's now write a query inside our application that fetches products where there are no votes. We'll need to import ProductSummaryFragment so we can properly type our function.
Hopefully you've found this article useful in getting started with Hygraph + GraphQL Code Generator. GraphQL Code Generator not only saves you a lot of time by automatically generating code, but it generates code that is type safe.
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.