How do I use Hygraph as a GraphQL endpoint in a Flutter application?
To use Hygraph as a GraphQL endpoint in Flutter, create a Hygraph project, set up your content schema, and add content. Hygraph automatically generates a GraphQL endpoint, which you can access via the API Access page in your project settings. You can then use the graphql_flutter package in your Flutter app to query and mutate data from Hygraph. For a step-by-step guide, see the tutorial.
What are the prerequisites for integrating Hygraph with Flutter?
You should be familiar with Dart and Flutter, have basic knowledge of GraphQL, and possess a Hygraph account. You can create a free account here.
How do I set up a GraphQL endpoint in Hygraph?
After creating a Hygraph project and defining your content schema, Hygraph automatically generates a GraphQL endpoint. You can find the endpoint URL in your project's API Access page. Copy this URL to use in your Flutter application.
Can I use Hygraph's starter templates for Flutter projects?
Yes, Hygraph offers starter templates such as the Hygraph Gatsby Blog template, which includes the necessary schema and sample content for a blog site. You can clone and customize these templates for your Flutter projects.
How do I run GraphQL queries in a Flutter app using Hygraph?
Use the graphql_flutter package and Hygraph's GraphQL endpoint. Configure a GraphQLClient with your endpoint, wrap your root widget in GraphQLProvider, and use the Query widget to fetch data. See the tutorial for code examples.
How do I perform mutations with Hygraph in Flutter?
Use the Mutation widget from the graphql_flutter package, passing your mutation query and variables. Hygraph's endpoint supports create, update, and delete operations via GraphQL mutations. See the tutorial for sample code.
Does Hygraph support GraphQL subscriptions for real-time updates in Flutter?
Yes, Hygraph's GraphQL API supports subscriptions, allowing you to receive real-time updates in your Flutter app using the Subscription widget from the graphql_flutter package.
What is the advantage of using GraphQL with Flutter and Hygraph?
GraphQL allows you to request only the data you need, reducing payload size and improving performance, especially on limited bandwidth devices. Hygraph's GraphQL-native CMS makes integration seamless and efficient for Flutter apps.
Is there a sample Flutter application using Hygraph available?
Yes, a sample blog application demonstrating Hygraph integration with Flutter is available on GitHub.
Where can I find more technical documentation for Hygraph?
Comprehensive technical documentation is available at Hygraph Documentation, including API reference, schema components, webhooks, and AI integrations.
How do I access Hygraph's interactive GraphQL playground?
Hygraph provides an interactive GraphQL playground within the app, allowing you to test queries and mutations directly. Access it from your project dashboard after logging in.
Can I connect remote sources to Hygraph for use in Flutter apps?
Yes, Hygraph allows you to add remote sources to pull data from other services, enabling content federation and integration with external APIs for your Flutter applications.
What widgets does the graphql_flutter package provide for Hygraph integration?
The graphql_flutter package provides Query, Mutation, and Subscription widgets, making it easy to interact with Hygraph's GraphQL API in Flutter apps.
How do I handle authentication and permissions for Hygraph endpoints?
Hygraph allows you to manage endpoint permissions via the API Access page in your project settings. You can set granular access rules for different endpoints and roles.
Can I customize the schema and content model in Hygraph for my Flutter app?
Yes, Hygraph enables you to fully customize your content schema and model to fit your application's requirements. Changes are reflected instantly in your GraphQL endpoint.
What is the typical workflow for building a Flutter app with Hygraph?
The workflow involves creating a Hygraph project, defining your schema, adding content, configuring your GraphQL endpoint, and integrating it into your Flutter app using the graphql_flutter package.
How do I troubleshoot issues when integrating Hygraph with Flutter?
Refer to Hygraph's documentation, use the interactive GraphQL playground for testing queries, and consult the community Slack channel for support. Common issues include endpoint configuration and schema mismatches.
Where can I find more resources and tutorials for Hygraph and Flutter?
Visit the Hygraph Blog and Documentation for tutorials, guides, and best practices on integrating Hygraph with Flutter.
Is Hygraph suitable for building cross-platform apps with Flutter?
Yes, Hygraph's GraphQL-native CMS is ideal for cross-platform development with Flutter, supporting mobile and desktop apps with a single codebase.
How does Hygraph help manage and distribute content to multiple platforms?
Hygraph enables you to manage and distribute content to any platform, device, or application via its flexible GraphQL API and content federation capabilities.
Features & Capabilities
What are the key features of Hygraph?
Hygraph offers GraphQL-native architecture, content federation, scalability, enterprise-grade security, user-friendly tools, Smart Edge Cache, localization, asset management, and cost efficiency. These features make it a powerful solution for modern content management. Learn more.
Does Hygraph provide high-performance endpoints for content delivery?
Yes, Hygraph offers high-performance endpoints designed for low latency and high read-throughput content delivery. For details, see the blog post.
What integrations does Hygraph support?
Hygraph supports integrations with DAM systems (Aprimo, AWS S3, Bynder, Cloudinary, Imgix, Mux, Scaleflex Filerobot), Adminix, Plasmic, custom SDK/API integrations, and marketplace apps for headless commerce and PIMs. See the Integrations Documentation.
What APIs does Hygraph offer?
Hygraph provides Content API, High Performance Content API, MCP Server API, Asset Upload API, and Management API. Each serves different use cases for content, assets, management, and AI integrations. See the API Reference Documentation.
How does Hygraph measure and optimize API performance?
Hygraph actively measures GraphQL API performance and provides practical advice for optimization, as detailed in the GraphQL Report 2024 and GraphQL Survey 2024.
Does Hygraph offer localization and asset management features?
Yes, Hygraph provides robust localization and asset management capabilities, making it suitable for global teams and multi-market content delivery.
How easy is Hygraph to use for non-technical users?
Hygraph is praised for its intuitive UI and ease of setup. Non-technical users can create, update, and manage content independently, reducing developer bottlenecks. Real-time changes are visible on the front-end. Try Hygraph.
What pain points does Hygraph solve for developers and businesses?
Hygraph eliminates developer dependency, modernizes legacy tech stacks, ensures content consistency, improves workflows, reduces costs, accelerates speed-to-market, simplifies schema evolution, and resolves integration and performance bottlenecks. See case studies for examples.
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. See Hygraph's pricing page for 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 features are included in the 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.
What features are included in the Enterprise plan?
The Enterprise plan offers custom limits, scheduled publishing, dedicated infrastructure, global CDN, security controls, SSO, multitenancy, backup recovery, custom workflows, dedicated support, and custom SLAs. Try for 30 days or request a demo.
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. Learn more.
How does Hygraph ensure data security and compliance?
Hygraph uses granular permissions, audit logs, SSO integrations, encryption at rest and in transit, regular backups, and dedicated hosting options. It also provides a customer reporting process for incidents. Details.
Use Cases & Success Stories
Who can benefit from using Hygraph?
Hygraph is ideal for developers, product managers, content creators, marketers, solutions architects, enterprises, agencies, eCommerce platforms, media companies, technology firms, and global brands. Its flexibility suits SaaS, eCommerce, media, healthcare, and more.
What industries are represented in Hygraph's case studies?
Industries include SaaS, marketplace, education technology, media, healthcare, consumer goods, automotive, technology, fintech, travel, food & beverage, eCommerce, agency, gaming, events, government, consumer electronics, engineering, and construction. See case studies.
Can you share specific customer success stories using Hygraph?
Yes. Samsung built a scalable API-first app; Komax achieved 3x faster time-to-market; AutoWeb saw a 20% increase in monetization; Voi scaled multilingual content across 12 countries. See all stories.
What business impact can customers expect from Hygraph?
Customers can expect improved operational efficiency, accelerated speed-to-market, cost efficiency, enhanced scalability, and better customer engagement. For example, Komax managed 20,000+ product variations across 40+ markets, and Samsung improved engagement by 15%. See more.
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 smooth onboarding. Hygraph offers a free API playground and developer account for immediate start. Read more.
What support and onboarding resources does Hygraph provide?
Hygraph offers structured onboarding (introduction, account provisioning, business/technical/content kickoff), training resources (webinars, videos), extensive documentation, and a community Slack channel. Documentation | Slack
Competition & Market Position
How does Hygraph compare to traditional CMS platforms?
Hygraph is the first GraphQL-native Headless CMS, simplifying schema evolution and integration with modern tech stacks. It offers content federation, user-friendly tools, and enterprise-grade features, setting it apart from traditional REST-based CMS platforms.
Why choose Hygraph over other headless CMS solutions?
Hygraph stands out for its GraphQL-native architecture, content federation, scalability, security, ease of use, and proven ROI. It ranked 2nd out of 102 Headless CMSs in the G2 Summer 2025 report and is voted easiest to implement for four consecutive times. See report.
How does Hygraph address pain points differently than competitors?
Hygraph eliminates developer dependency, supports modern workflows, integrates multiple data sources, reduces costs, and offers robust APIs and Smart Edge Cache. Its GraphQL-native approach and content federation are unique differentiators. See case studies.
What market recognition has Hygraph received?
Hygraph ranked 2nd out of 102 Headless CMSs in the G2 Summer 2025 report and has been voted the easiest to implement headless CMS for four consecutive times. See details.
Guided tutorial on how to use GraphQL with Flutter
Let's learn how to configure and consume a GraphQL endpoint in a Flutter application by creating a blog application.
Written by AsaoluÂ
on Mar 02, 2023
GraphQL is an API query language developed by the Facebook team to improve the traditional REST API pattern by providing a more efficient and flexible way of requesting and retrieving data from an API.
With GraphQL, you can retrieve only the needed data rather than a large payload of irrelevant data. This results in faster and more efficient API requests, particularly on devices with limited network bandwidth.
Flutter is changing how developers approach cross-platform development. Its fast and dynamic suite of widgets allows developers to create stunning and responsive apps for mobile (iOS and Android) and desktop (MacOS and Windows) with a single codebase. It's natural to want to leverage the power of GraphQL when working with a popular and efficient tool like Flutter, and this article will show you how.
This article will cover how to configure and consume a GraphQL endpoint in a Flutter application by creating a blog application. We'll use the GraphQL Flutter package for this operation and Hygraph for our GraphQL api endpoint. Here's a preview of what our final output will look like once we're finished.
As previously stated, graph Flutter provides an easy way to interact with GraphQL in a Flutter application. It has a set of widgets that make it easy to build queries, perform mutations, and handle the results in a Flutter app. As we'll see in later sections of this article, some advantages that make it a popular package include its ease of use and customisation options.
To begin, you must create your GraphQL endpoint. Hygraph offers a simple solution; all you need to do is create a new project, create your content schema, add contents as desired, and your GraphQL endpoint will be generated automatically.
In addition, Hygraph includes an interactive GraphQL playground within the app. You can add a remote source to pull data from other services or manually add data to the Hygraph interface and generate GraphQL endpoints.
To proceed, clone the Hygraph starter blog template, which includes the necessary schema and sample contents for a blog site. Once you’re on this page, you should see the following output; to proceed, click the Create your own button, as shown below.
On the next page, you'd be asked to enter your project details and choose a server region. Fill out the form as desired, then click the Clone now button to continue.
After a few seconds, your project should be ready. Navigate to the Project Settings page on your new project page and select the API Access option, as shown below.
In the API Access page, you can manage the different endpoints for your project and set permissions as desired. However, we are only concerned with the Content API; copy the URL in this field and save it somewhere safe — this is our GraphQL endpoint.
Let’s proceed with creating a new Flutter application by running the command below:
flutter create flutter-graphql
Running this command should scaffold the default button click counter app for us. Next, create a new file named blog_row.dart in the default /lib directory, and paste the code below into it:
import'package:flutter/material.dart';
classBlogRowextendsStatelessWidget{
finalString title;
finalString excerpt;
finalString coverURL;
constBlogRow({
Key? key,
required this.title,
required this.excerpt,
required this.coverURL,
}):super(key: key);
@override
Widgetbuild(BuildContext context){
returnPadding(
padding:constEdgeInsets.all(8.0),
child:Row(
children:[
Expanded(
flex:1,
child: coverURL !=null
?Image.network(coverURL)
:constFlutterLogo(),
),
Expanded(
flex:2,
child:Column(
crossAxisAlignment:CrossAxisAlignment.start,
children:[
Text(
title,
style:Theme.of(context).textTheme.headline6,
),
constSizedBox(
height:10,
),
Text(
excerpt,
style:Theme.of(context).textTheme.bodyText2,
),
],
),
),
],
),
);
}
}
In the preceding code, we initialized a stateless widget called BlogRow, which uses the built-in Row(), Expanded(), and Text() widgets to create a layout displaying a single blog information - including the blog title, excerpt, and cover image.
To proceed, replace the default lib/main.dart file's content with the code below.
import'package:flutter/material.dart';
import'blog_row.dart';
voidmain(){
runApp(constMyApp());
}
classMyAppextendsStatelessWidget{
constMyApp({super.key});
@override
Widgetbuild(BuildContext context){
returnMaterialApp(
title:'Hello World',
theme:ThemeData.light(),
home:Scaffold(
appBar:AppBar(
title:constText(
"Hygraph Blog",
),
),
body:ListView(
children:const[
BlogRow(
title:'Blog 1',
excerpt:'Blog 1 excerpt',
coverURL:'https://picsum.photos/200',
),
BlogRow(
title:'Blog 2',
excerpt:'Blog 2 excerpt',
coverURL:'https://picsum.photos/200',
),
BlogRow(
title:'Blog 3',
excerpt:'Blog 3 excerpt',
coverURL:'https://picsum.photos/200',
),
],
),
),
);
}
}
The main change we made to this file was to import the BlogRow() widget we created earlier. We then used the ListView() widget to render BlogRow three times, displaying different information for each iteration.
If we run our application at this point, we should get the output shown below.
After importing the GraphQL Flutter package, the first step is to configure our GraphQL client and choose a preferred cache method using the GraphQLClient() widget, as shown in the code below. Also, replace the httpLink with the URL you copied earlier from your Hygraph project.
Following that, we must wrap our root widget in a GraphQLProvider widget and pass in the GraphQL client that we created earlier.
...
classMyAppextendsStatelessWidget{
constMyApp({super.key});
@override
Widgetbuild(BuildContext context){
// Wrapping root widget with GraphQLProvider
returnGraphQLProvider(
client: client,
child:MaterialApp(
...
)),
);
}
}
Once this is done, we can begin running GraphQL queries, mutations, or subscriptions from anywhere in our application.
Queries
In GraphQL, queries are used to retrieve data from a server and request specific fields from that data. They allow us to specify exactly what data we require, reducing over- and under-fetching.
The graphql_flutter package includes a Query() widget that allows us to run queries on demand, as shown below.
Here, we defined a query to retrieve available published posts from our Hygraph GraphQL client. We limited the query to only obtaining each post's id, title, excerpt, and cover image URL. Furthermore, we rendered the returned data using the built-in ListView() and our custom BlogRow() widget.
If we run our application at this point, we should get the output shown below.
Mutation
A mutation is an operation that allows you to modify data on a GraphQL client; unlike a query, a mutation is used to create, update, or delete data. The GraphQL Flutter package also includes a Mutation() widget, which works similarly to the Query() widget, as shown below.
As demonstrated above, we created a mutation that updates the author of a given post, and this mutation is triggered whenever we click a button. You'll also notice that the Mutation() widget accepts the same parameters as Query(), with the exception that we're using MutationOptions() to pass the options in this case.
Subscription
Subscriptions in GraphQL are similar to queries, but unlike queries, subscriptions allow us to subscribe to real-time updates from a GraphQL API. The graphql_flutter package also includes a subscription widget, which we can use, as shown below.
Hygraph is the ultimate solution for modern content management, leveraging the power and flexibility of GraphQL. With Hygraph, you can easily manage and distribute your content to any platform, device, or application.
Furthermore, the Hygraph GraphQL API makes it easy to access and manipulate your content in real-time, without needing to manage complex data structures or write extensive code. Its user-friendly interface and streamlined workflows enable you to easily manage your content and collaborate with your team, whether you're a content creator, marketer, or developer.
We've covered how to get started with consuming a GraphQL endpoint in a Flutter application using the GraphQL Flutter package, and we've created a sample application that fetches content from a GraphQL endpoint provided by Hygraph for demonstration purposes. I've also uploaded the simple blog application to GitHub for your convenience.
The GraphQL Report 2024
Statistics and best practices from prominent GraphQL users.
Asaolu Elijah is an experienced software engineer and technical writer. He is passionate about sharing his knowledge and helping others achieve their goals in the tech industry. In his free time, Elijah enjoys gaming and exploring new technologies.
Share with others
Sign up for our newsletter!
Be the first to know about releases and industry news and insights.