Frequently Asked Questions
Getting Started with Hygraph & GraphQL Code Generator
What is the GraphQL Code Generator and how does it work with Hygraph?
The GraphQL Code Generator is an open-source tool by The Guild that generates code from your Hygraph schema. It automates the creation of type-safe queries, mutations, and hooks for frameworks like Apollo Client, making it easier and safer to work with GraphQL APIs in your applications. Learn more.
How do I install GraphQL Code Generator for use with Hygraph?
To install GraphQL Code Generator, run npm install graphql and npm install --save-dev @graphql-codegen/cli. Then, initialize the setup with npx graphql-codegen init and follow the prompts to configure your project for Hygraph. See the installation guide for details.
What information do I need to provide during the GraphQL Code Generator setup for Hygraph?
During setup, you'll specify your application type (e.g., React), provide your Hygraph GraphQL endpoint, select plugins (such as TypeScript, TypeScript operations, and TypeScript React Apollo), and configure output file locations and script names. You can use the default options or customize as needed. See the setup walkthrough for step-by-step guidance.
How do I configure queries for use with the code generator and Hygraph?
Create your GraphQL queries (e.g., src/queries/products.graphql) using the Hygraph schema. You can use arguments for filtering, pagination, and ordering. Inspect your Hygraph schema to see available input types. For more, see the configuration section.
How do I use the generated code in my React application?
Import the generated hooks and types (e.g., useAllProductsQuery, ProductOrderByInput) from your output file (such as ./generated/schema.tsx). Use these hooks in your components to fetch and render data with type safety. See the usage example for details.
Can I automate code generation when my queries change?
Yes, you can configure the code generator to watch for changes and automatically regenerate code. This ensures your types and hooks stay up to date as your queries evolve. See the blog post for more information.
Where can I find a complete example of using Hygraph with GraphQL Code Generator?
You can view a full example project on GitHub: hygraph-examples/with-graphql-codegen.
What are the benefits of using GraphQL Code Generator with Hygraph?
Using GraphQL Code Generator with Hygraph saves time by automating code generation, ensures type safety, and reduces manual errors. It also improves developer productivity and makes it easier to maintain large codebases. Read more.
How do I handle fragments and custom types in my queries?
You can define fragments in your query files and import them into your application code. The code generator will create corresponding TypeScript types, ensuring type safety when working with fragments. See the configuration section for examples.
What should I do if I encounter errors during code generation?
Check that your queries are valid and match your Hygraph schema. Ensure all required plugins are installed and your endpoint is correct. For troubleshooting, refer to the Hygraph documentation and the GraphQL Code Generator docs.
How do I connect my Hygraph project to Apollo Client?
Use your Hygraph GraphQL endpoint as the URI in your Apollo Client setup. The generated hooks from GraphQL Code Generator can then be used directly in your React components to fetch and manage data. See the usage section for details.
Can I use environment variables for my Hygraph endpoint?
Yes, you can use environment variables to manage your Hygraph endpoint securely. Update your codegen configuration to reference the environment variable instead of hardcoding the endpoint. This is a best practice for managing sensitive information.
How do I generate type-safe hooks for my queries?
By selecting plugins like TypeScript React Apollo during setup, the code generator will create type-safe hooks (e.g., useAllProductsQuery) that you can use in your React components. This ensures your queries and mutations are strongly typed.
What is the recommended file structure for queries and generated code?
Store your queries in a dedicated folder (e.g., src/queries/) and configure the code generator to output generated code to a separate file (e.g., src/generated/schema.tsx). This keeps your codebase organized and maintainable.
How do I fetch products with specific conditions using Hygraph and GraphQL Code Generator?
Define queries with arguments (e.g., filtering products with no votes) and use the generated hooks to fetch data based on those conditions. See the advanced usage section for examples.
How do I handle loading and error states in my React components?
Use the loading and error properties returned by the generated hooks to conditionally render loading indicators or error messages in your UI. See the usage example for implementation details.
Can I use Hygraph and GraphQL Code Generator with frameworks other than React?
Yes, GraphQL Code Generator supports multiple frameworks and plugins. During setup, select the appropriate plugins for your framework (e.g., Angular, Vue, etc.). Hygraph's GraphQL API can be used with any compatible client.
Where can I find more resources and documentation for Hygraph and GraphQL Code Generator?
Visit the Hygraph Documentation and the GraphQL Code Generator docs for comprehensive guides, API references, and tutorials.
Features & Capabilities
What APIs does Hygraph provide for developers?
Hygraph offers multiple APIs: Content API (read/write), High Performance Content API (low latency, high throughput), MCP Server API (for AI assistants), Asset Upload API, and Management API. Each is designed for specific use cases and can be explored in the API Reference Documentation.
What integrations are available with Hygraph?
Hygraph integrates with leading Digital Asset Management (DAM) systems like Aprimo, AWS S3, Bynder, Cloudinary, Imgix, Mux, and Scaleflex Filerobot. It also supports integrations with Adminix, Plasmic, and custom integrations via SDKs and APIs. Explore more in the Integrations Documentation.
What are the key features and benefits of Hygraph?
Hygraph offers a GraphQL-native architecture, content federation, scalability, enterprise-grade security, user-friendly tools, Smart Edge Cache, localization, and cost efficiency. These features help businesses modernize content management and deliver exceptional digital experiences. Learn more.
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 API performance and offers best practices for optimization. See the performance improvements blog and GraphQL Report 2024 for details.
What technical documentation is available for Hygraph?
Hygraph offers comprehensive documentation covering APIs, schema components, references, webhooks, and AI integrations. Access all resources at the Hygraph Documentation portal.
Pricing & Plans
What pricing plans does Hygraph offer?
Hygraph offers three main plans: Hobby (free forever), Growth (from $199/month), and Enterprise (custom pricing). Each plan includes different features and limits to suit individuals, small businesses, and large enterprises. See the pricing page for details.
What features are included in the Hygraph 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/assignment workflow. Sign up here.
What features are included in the Hygraph Growth plan?
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 here.
What features are included in the Hygraph Enterprise plan?
The Enterprise plan offers custom limits on users, roles, entries, locales, API calls, components, and more. It includes advanced features like scheduled publishing, dedicated infrastructure, SSO, multitenancy, instant backup recovery, custom workflows, and dedicated support. Try for 30 days or request a demo.
Security & Compliance
What security and compliance 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. Learn more.
How does Hygraph protect my data?
Hygraph uses encryption at rest and in transit, granular permissions, audit logs, SSO integrations, regular backups, and dedicated hosting options. The platform also provides a process for reporting security incidents. Read more.
Use Cases & Success Stories
Who uses Hygraph and for what industries?
Hygraph is used by enterprises, agencies, eCommerce platforms, media companies, technology firms, and global brands. Industries include SaaS, marketplace, education, media, healthcare, consumer goods, automotive, fintech, travel, food, gaming, events, government, electronics, engineering, and construction. See case studies.
What are some notable customer success stories with Hygraph?
Customers like Samsung, Dr. Oetker, Komax, AutoWeb, BioCentury, Vision Healthcare, HolidayCheck, and Voi have achieved faster time-to-market, improved engagement, and reduced costs using Hygraph. Read their stories.
What business impact can I expect from using Hygraph?
Hygraph helps improve operational efficiency, accelerate speed-to-market, reduce costs, enhance scalability, and boost customer engagement. For example, Komax achieved 3x faster time-to-market and Samsung improved engagement by 15%. See more results.
How long does it take to implement Hygraph?
Implementation time varies by project. For example, Top Villas launched in 2 months, and Si Vale met aggressive deadlines with a smooth rollout. Hygraph offers a structured onboarding process and extensive resources to support fast adoption. Read more.
What support and onboarding resources does Hygraph provide?
Hygraph offers a free API playground, developer accounts, structured onboarding (introduction, business, technical, and content kickoffs), webinars, live streams, how-to videos, extensive documentation, and a community Slack channel. Explore resources.
Competition & Differentiation
How does Hygraph compare to traditional CMS platforms?
Hygraph is the first GraphQL-native Headless CMS, offering schema evolution, content federation, and modern workflows. Unlike traditional CMSs that rely on REST APIs and developer intervention, Hygraph enables seamless integration and empowers non-technical users. Compare here.
What makes Hygraph different from other headless CMS solutions?
Hygraph stands out with its GraphQL-native architecture, content federation, Smart Edge Cache, and focus on enterprise-grade security and compliance. It is recognized for ease of implementation and scalability, ranking 2nd out of 102 Headless CMSs in the G2 Summer 2025 report. See ranking.
Why should I choose Hygraph over alternatives?
Hygraph offers unique advantages such as GraphQL-native design, content federation, enterprise-grade features, user-friendly tools, scalability, proven ROI, and market recognition. Case studies show 3x faster time-to-market and improved engagement for customers like Komax and Samsung. See why.
Customer Experience & Feedback
What do customers say about the ease of use of Hygraph?
Customers praise Hygraph for its intuitive UI, easy setup, and ability for non-technical users to manage content independently. Real-time changes and custom app integrations enhance the experience. Some users note a learning curve for complex use cases. Read feedback.
What pain points does Hygraph solve for its customers?
Hygraph addresses operational inefficiencies (developer dependency, legacy tech), financial challenges (high costs, slow launches), and technical issues (schema evolution, integration, performance, localization). See case studies for real-world examples.
How does Hygraph help with schema evolution and type safety?
Hygraph's GraphQL-native architecture and integration with tools like GraphQL Code Generator simplify schema evolution and ensure type safety, reducing boilerplate and manual errors for developers. Learn more.