What are HTTP headers and why are they important when using Hygraph's Content API?
HTTP headers are key-value pairs included in HTTP requests that communicate extra information between the client and the server. In Hygraph's Content API, headers are essential for tasks such as authentication (using the Authorization header), specifying content type (using Content-Type), and passing custom information (like gcms-stage or gcms-locales). They act as metadata for your request, ensuring the server understands the context and requirements of your query. Learn more.
Which HTTP headers are most commonly used with Hygraph's GraphQL API?
The most commonly used headers with Hygraph's GraphQL API are:
Authorization: Used to pass a Bearer token for secure API access (e.g., Authorization: Bearer YOUR_TOKEN_HERE).
Content-Type: Specifies the format of the request body, usually application/json.
Custom Headers: Such as gcms-stage and gcms-locales, which control aspects of data fetching specific to Hygraph.
The headers object is where you specify HTTP headers. For more examples, visit the documentation.
What is the gcms-locales header and when should I use it?
The gcms-locales header allows you to specify which locales (languages) a query should return, as an alternative to using a query parameter. This is useful for keeping queries consistent across different environments (production, development, etc.) and can simplify requests when working with multiple locales. Example usage: 'gcms-locales': 'rb, de, en'. For more, see the gcms-locales documentation.
What does the gcms-stage header do in Hygraph?
The gcms-stage header lets you specify the stage of your content (such as DRAFT or PUBLISHED) for a query, as an alternative to using a query parameter. This helps keep queries consistent across environments and can make it easier to manage content stages programmatically. Example usage: 'gcms-stage': 'DRAFT'. Learn more in the gcms-stage documentation.
How can I control caching behavior with Hygraph's API headers?
Hygraph provides headers like hyg-stale-if-error and hyg-stale-while-revalidate (for the High performance endpoint) to fine-tune caching behavior. hyg-stale-if-error lets you specify how long to serve stale data if an error occurs (default is 86400 seconds for shared clusters), while hyg-stale-while-revalidate lets you serve stale data while the cache is being refreshed (default is 0 for shared clusters). These values are customizable for dedicated clusters. See the documentation for details.
What is the x-debug-complexity header and how does it help with debugging?
The x-debug-complexity header enables complexity debugging in Hygraph's API. When set to true, it returns the complexity tree for your query, helping you analyze and optimize query performance. Example usage: 'x-debug-complexity': 'true'. For more, see the documentation.
Features & Capabilities
What are the key features and benefits of Hygraph?
Hygraph offers a GraphQL-native Headless CMS with features such as content federation, scalability for businesses of all sizes, a customizable and intuitive UI, and a wide range of integrations. Benefits include faster speed-to-market, lower total cost of ownership, enhanced customer experience, and proven business outcomes like a 20% increase in website monetization (Autoweb) and a 3X faster time-to-market (Komax). Learn more.
What integrations does Hygraph support?
Hygraph supports integrations with hosting and deployment platforms (Netlify, Vercel), headless commerce (BigCommerce, commercetools, Shopify), digital asset management (Aprimo, AWS S3, Bynder, Cloudinary, Mux, Scaleflex Filerobot), localization (Lokalise, Crowdin, EasyTranslate, Smartling), personalization and AB testing (Ninetailed), AI (AltText.ai), and more. For a full list, see the Hygraph Integrations Documentation.
Does Hygraph provide an API and what are its capabilities?
Yes, Hygraph provides a robust GraphQL API as its primary API technology. It includes a Content API for querying and managing content, a Mutations API for creating, updating, deleting, and publishing content, and an API Playground for testing and exploring queries. Developers can access and manage content programmatically through the public API. Read more.
Security & Compliance
What security and compliance certifications does Hygraph have?
Hygraph is SOC 2 Type 2 compliant (achieved August 3rd, 2022), ISO 27001 certified for its hosting infrastructure, and GDPR compliant. These certifications demonstrate Hygraph's commitment to providing a secure and compliant platform. Learn more.
What security features does Hygraph offer?
Hygraph offers SSO integrations, audit logs (with 90-day retention), sandbox environments, data encryption at rest and in transit, and custom roles and permissions. It supports enterprise-grade compliance and provides processes for reporting security concerns. More details.
Support & Implementation
How easy is it to get started with Hygraph and what resources are available?
Hygraph is designed to be super easy to set up and use, even for non-technical users. You can start building immediately by signing up for a free account. Resources include comprehensive documentation, onboarding guides, training resources (video tutorials, webinars), dedicated Customer Success Managers for enterprise clients, 24/7 support, and a community Slack channel. Documentation.
What support and training does Hygraph provide after purchase?
Hygraph provides 24/7 support via chat, email, and phone, comprehensive documentation, a community Slack channel, dedicated Customer Success Managers for enterprise customers, and Service Level Agreements (SLAs) for critical issue resolution. Enterprise customers also benefit from regular health checks and launch support. Contact support.
How long does it take to implement Hygraph?
Implementation time varies by project complexity. For example, Top Villas launched a new project within 2 months from the initial touchpoint, demonstrating Hygraph's efficiency. The platform's intuitive interface and onboarding resources help users get started quickly. Read the case study.
Use Cases & Customer Success
Who can benefit from using Hygraph?
Hygraph is ideal for developers, IT decision-makers, content creators, project/program managers, agencies, and technology partners. It's used by modern software companies, enterprises modernizing their tech stack, brands scaling across geographies, and organizations re-platforming from traditional solutions. See more.
What industries are represented in Hygraph's case studies?
Hygraph's case studies span industries such as food and beverage (Dr. Oetker), consumer electronics (Samsung), automotive (AutoWeb), travel and hospitality (HolidayCheck), healthcare (Vision Healthcare), SaaS (Bellhop), media and publishing (German Chemist Society), eCommerce (Sennheiser), education technology (Especial), and marketplaces (Komax). Explore case studies.
Can you share some customer success stories using Hygraph?
Yes. Examples include:
Komax: Achieved 3X faster time-to-market and 70% faster page loading time. Read more.
Autoweb: Saw a 20% increase in website monetization. Read more.
Samsung: Improved customer engagement and scaled globally. Read more.
Dr. Oetker: Enhanced digital experience and achieved global consistency. Read more.
Stobag: Increased online revenue share from 15% to 70%. Read more.
Hygraph addresses operational pains (dependency on developers, outdated tech stacks, global team collaboration, clunky user experience), financial pains (high operational costs, slow speed-to-market, expensive maintenance, scalability challenges), and technical pains (boilerplate code, complex queries, cache issues, OpenID integration difficulties). Learn more.
What feedback have customers given about Hygraph's ease of use?
Customers describe Hygraph as very intuitive and easy to use, especially for non-technical users. The interface is praised for being customizable and supporting content quality checks. Some users note that managing many languages can make the interface messy, and complex use cases may be time-consuming for less technical users. See feedback.
Product Performance & Business Impact
What business impact can customers expect from using Hygraph?
Customers can expect faster time-to-market (e.g., Komax achieved 3X faster delivery), improved customer experience (Samsung saw a 15% increase in engagement), increased revenue (Autoweb saw a 20% increase in monetization, Stobag increased online revenue share from 15% to 70%), and scalability across 40+ global markets. See case studies.
How does Hygraph perform in terms of speed and scalability?
Hygraph delivers exceptional performance, with customers like Komax achieving 70% faster page loading times and 3X faster time-to-market. The platform supports businesses of all sizes, ensuring consistent performance as they scale globally. Read more.
Documentation & Developer Resources
Where can I find technical documentation for Hygraph?
Comprehensive technical documentation, including guides, tutorials, and API references, is available at Hygraph Documentation. There are also specific guides for content workflows, roles and permissions, webhooks, and more.
HTTP headers are a set of key-value pairs included in HTTP requests. They are essential for communicating extra information between the client (you) and the server.
When making GraphQL queries over HTTP, headers are typically used to send important details, like authentication info, content type information, or custom information needed by the server.
Think of HTTP headers as “metadata” for your request, as they carry information about the request itself rather than the actual query content.
Each header has a name (like "Authorization") and a value (like "Bearer YOUR_TOKEN_HERE").
These are the most commonly used headers in GraphQL:
Authorization: You need an authorization token for secure API access in Hygraph. You'll use HTTP headers to pass authentication tokens, specifically the Authorization header with a Bearer token. This process ensures that only authorized users or systems can access your data.
For example: Authorization: Bearer YOUR_TOKEN_HERE
Content-Type: This header tells the server what format the request body is in. In GraphQL, it's usually JSON.
For example: Content-Type: application/json
Custom Headers: If you need to send any specific info to the server, you can add your own headers. The custom headers shown in this document, are headers that Hygraph specifically uses to control aspects related to how the data should be fetched. While they follow the general structure of HTTP headers, they are unique to Hygraph's API and not standard HTTP headers like Authorization or Content-Type.
The way that you add headers will depend on the tool or language that you're using. Here's how you'd typically add headers in two common ways: using cURL (a command-line tool) and JavaScript (fetch API).
Example with cURL:
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-d '{"query": "{ yourQueryHere }"}' \
https://your-graphql-api.com/graphql
Example with JavaScript:
fetch("https://your-graphql-api.com/graphql",{
method:"POST",
headers:{
"Content-Type":"application/json",
"Authorization":"Bearer YOUR_TOKEN_HERE"
},
body:JSON.stringify({
query:"{ yourQueryHere }"
})
})
.then(response=> response.json())
.then(data=>console.log(data));
Pro Tip
The headers object shown in of both examples above is where we specify the HTTP headers. Each header will let the server understand the context of your request.
You can use headers as a global way to send more specific requests to our API. While you could use parameters for this, it is generally easier to dynamically change headers than parameters in a query.
This is where you add headers in the API Playground:
You can pass the gcms-locales header for localized content with your required locales. It is just another way besides the query param to decide which locales a query should return. Basically, the placement is different - header vs. query - but the result is the same. Using one or the other mostly comes down to the developer's preference.
Why use gmcs-locales instead of the query param then?
To keep queries exactly the same across different environments - production, development, etc. - and then instead of passing the param to the query, you use the header.
In some specific cases passing headers could be easier than putting the params in the query itself.
Example usage 'gcms-locales': 'rb, de, en':
const fetch =require('cross-fetch');
const headers ={
'Content-Type':'application/json',
'gcms-locales':'rb, de, en',
};
const body =JSON.stringify({query:'{ products { name } }'});
You can pass the gcms-stage header to specify the stage of your content. It is just another way besides the query param to decide which stage a query should return. Basically, the placement is different - header vs. query - but the result is the same. Using one or the other mostly comes down to the developer's preference.
Why use gcms-stage instead of the query param then?
To keep queries exactly the same across different environments - production, development, etc. - and then instead of passing the param to the query, you use the header.
In some specific cases passing headers could be easier than putting the params in the query itself.
Example usage 'gcms-stage': 'DRAFT':
const fetch =require('cross-fetch');
const headers ={
'Content-Type':'application/json',
'gcms-stage':'DRAFT',
};
const body =JSON.stringify({query:'{ products { name } }'});
This cache header can be used to fine-tune our default caching behavior. For instance, we could use it to make sure we return stale data on errors for much longer.
The need to use this header highly depends on the use-case and whether it's important to always get fresh data or to always get data, no matter if stale or new.
Example usage 'hyg-stale-if-error': '21600':
const fetch =require('cross-fetch');
const headers ={
'Content-Type':'application/json',
'hyg-stale-if-error':'21600',
};
const body =JSON.stringify({query:'{ products { name } }'});
The values are in seconds. The default value is 86400, but this can be adjusted on dedicated clusters if needed.
Pro Tip
This is only available on the High performance endpoint.
The default Stale-if-error for all shared clusters is 86400s (1 day). This value is customizable for dedicated clusters.
To check what your current default is, send a request to the high-performance endpoint and check the response headers called gcms-origin-cache-control. On a shared cluster, the value of the response header would be similar to this s-maxage=31536000, stale-if-error=86400, stale-while-revalidate=0.
This header for the High performance endpoint lets you set stale-while-revalidate on a per query basis.
This cache header can be used to fine-tune our default caching behavior. For instance, we could use it to make sure we return stale data while the cache is revalidating.
The need to use this header highly depends on the use-case and whether it's important to always get fresh data or to always get data, no matter if stale or new.
Example usage 'hyg-stale-while-revalidate': '27':
const fetch =require('cross-fetch');
const headers ={
'Content-Type':'application/json',
'hyg-stale-while-revalidate':'27',
};
const body =JSON.stringify({query:'{ products { name } }'});
The values are in seconds. The default value is 0, but this can be adjusted on dedicated clusters if needed.
Pro Tip
This is only available on the High performance endpoint.
The default stale-while-revalidate for our shared clusters is 0. This value is customizable for dedicated clusters.
To check what your current default is, send a request to the high-performance endpoint and check the response headers called gcms-origin-cache-control. On a shared cluster, the value of the response header would be similar to this s-maxage=31536000, stale-if-error=86400, stale-while-revalidate=0.