What is Hygraph and how can it be used with Flutter?
Hygraph is a GraphQL-native headless CMS that enables developers to manage and deliver content efficiently to web and mobile applications. In the context of Flutter, Hygraph can power dynamic apps by providing a flexible API for content delivery, enabling real-time updates, and streamlining content management for developers. For example, you can architect a fan club app in Flutter that fetches show data from Hygraph using GraphQL queries. (Source)
What are some typical use cases for Hygraph?
Hygraph is used across industries for powering websites, mobile apps, eCommerce platforms, media and publishing, education technology, and more. Case studies include companies like Samsung (consumer electronics), Dr. Oetker (food and beverage), HolidayCheck (travel and hospitality), and Komax (industrial automation), each leveraging Hygraph for scalable, modern digital experiences. (Case Studies)
Features & Capabilities
What are the key features of Hygraph?
Hygraph offers a GraphQL-native architecture, content federation, scalability, and a flexible schema definition tool. It supports integrations with popular platforms (Netlify, Vercel, Shopify, AWS S3, Cloudinary, etc.), provides enterprise-grade security, and enables rapid content delivery for improved user experience and SEO. (Features)
Does Hygraph provide an API for content management?
Yes, Hygraph provides a powerful GraphQL API that allows you to fetch and manage content efficiently. This API is ideal for integrating with frameworks like Flutter, enabling dynamic content delivery and real-time updates. (API Reference)
What integrations are available with Hygraph?
Hygraph supports a wide range of integrations, including hosting and deployment (Netlify, Vercel), eCommerce (Shopify, BigCommerce, commercetools), localization (Lokalise, Crowdin, Smartling), digital asset management (AWS S3, Cloudinary, Bynder, Aprimo), personalization (Ninetailed), and AI (AltText.ai). (Integrations)
Technical Requirements & Implementation
How do I fetch and render content from Hygraph in a Flutter app?
You can fetch and render content from Hygraph in Flutter by using the graphql_flutter package to send GraphQL queries to the Hygraph API. Start by cloning a sample Hygraph blog app project, which includes basic content models. The process involves defining your schema in Hygraph, setting up a GraphQL client in Flutter, and using providers (e.g., Riverpod) to manage state and data fetching. (Flutter Implementation Guide)
What are the prerequisites for using Flutter with Hygraph?
To use Flutter with Hygraph, you need the Flutter SDK and its dependencies installed, basic knowledge of Dart, and an iOS simulator and/or Android Studio on your machine. These prerequisites ensure you can build, test, and deploy your Flutter app integrated with Hygraph. (Flutter Implementation Guide)
What resources are available for implementing Hygraph with Flutter?
Hygraph provides a Flutter connection guide, a basic blog app example, starter templates, and documentation to help you integrate Hygraph with Flutter. These resources cover everything from initial setup to advanced content modeling and API usage.
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 the most up-to-date details, visit the Hygraph 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 like SSO integrations, audit logs, encryption at rest and in transit, and sandbox environments to protect sensitive data and meet regulatory standards. (Security Features)
Customer Success & Case Studies
Can you share specific customer success stories using Hygraph?
Yes. For example, Komax achieved a 3X faster time to market, Autoweb saw a 20% increase in website monetization, and Samsung improved customer engagement with a scalable platform. Dr. Oetker enhanced their digital experience using MACH architecture. More stories are available on the Hygraph product page.
Support & Training
What support and training does Hygraph offer?
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, webinars, and a community Slack channel. (Contact Page)
Performance & Metrics
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. (Performance Details)
Getting Started
How easy is it to get started with Hygraph?
Hygraph is designed for ease of use, with an intuitive interface praised by customers. Even non-technical users can start quickly by signing up for a free account and using onboarding guides and documentation. For example, Top Villas launched a new project in just 2 months. (Documentation, Top Villas Case Study)
Customer Proof
Who are some of Hygraph's customers?
Hygraph is trusted by companies such as Sennheiser, HolidayCheck, Ancestry, Samsung, Dr. Oetker, Epic Games, Bandai Namco, Gamescom, Leo Vegas, and Clayton Homes. (Case Studies)
Let's architect a simple Jimmy Buffett Fan Club app in Flutter, powered by Hygraph.
Written by Adam
on Jun 12, 2024
There’s not a lot of articles online about Jimmy Buffett and production-ready Flutter architecture. Excuse me. Jimmy Buffett GraphQL and production-ready Flutter architecture – common mistake.
We’re here to remedy all that, so buckle up Parrot Heads, let's architect a simple Jimmy Buffett Fan Club app in Flutter, powered by Hygraph, our favorite GraphQL CMS.
The Github repo for this tutorial can be found here.
There is no consensus on the best architecture for Flutter, but we’re going to go with Riverpod architecture today for a few reasons.
1. Scalability and flexibility: Riverpod offers a highly scalable architecture that is well-suited for large and complex applications. It provides a clear separation of concerns, making it easy to manage state across different parts of the app.
2. Performance and testing: Riverpod is designed with performance in mind, reducing unnecessary rebuilds and optimizing resource usage. Additionally, it simplifies the testing process by providing a more predictable and maintainable state management solution. With Riverpod, you can write unit tests for your state logic without relying on Flutter-specific code.
3. 🤌 Developer experience: Riverpod's robust tooling and integration with the Dart ecosystem improve the overall developer experience. It supports features like hot reload, state persistence, and dependency injection out of the box.
Riverpod has proven to be a solid choice in our Flutter apps and has held up well.
The app we’re building today is very simple. It will display a list of the best Jimmy Buffett shows for our Parrot Head fan club. You can then click through to get details about the set list and how many fans have voted for this show.
We’ll be building this using Flutter Web but the same codebase is used to create iOS, Android, and desktop apps.
In our Flutter app, we’re going to model this GraphQL schema using the Freezed package. To get started just add Freezed to your pubspec.yaml. Freezed is typically used with REST APIs, but there’s no reason you can’t use it with GraphQL. It provides all the same great time-saving benefits.
With this simple model file and the Freezed codegen tool:
We get the following out of the box (AKA we save a lot of typing):
a constructor + the properties
override toString, operator ==, hashCode
a copyWith method to clone the object
handling de/serialization
Now, in order to set up Riverpod and the Riverpod generator add the latest versions to your pubspec.yaml and simply wrap your entire app in a ProviderScope
Here we’re setting up the Provider where we define how to fetch and manage the list of Shows using GraphQL. Let's break down the key parts of this setup:
We start by defining the GraphQL query that will fetch the list of shows from our Hygraph server. This query retrieves various details about each show, such as the playlist, vote count, date, city, ID, and image URL.
staticconstString query ="""
query FetchShows{
shows(){
playlist
vote_count
date
city
id
image_url
}
}
""";
Next, we create an HttpLink to specify the endpoint of our Hygraph API. This will be used by the GraphQLClient to send requests to Hygraph. We can then instantiate a GraphQLClient which will be responsible for making the actual network requests.
Now in the UI, the ShowsScreen widget listens to the showsListProvider using ref.watch. This provider returns an AsyncValue<List>, which represents the state of the asynchronous operation.
The when method is used to handle the different states of the AsyncValue:
data: Displays a list of shows using a ListView.builder.
loading: Shows a CircularProgressIndicator while the data is being fetched.
error: Displays an error message if there was an issue fetching the data.
Each show is displayed in a ListTile with the city name, date, and an image. When a show is tapped, it navigates to a ShowScreen with the details of the selected show. In a production app, we’d use the go_router package, but that’s outside the scope of this article.
This guide delved into creating a production-ready Flutter app using Riverpod and Hygraph, focusing on state management and GraphQL integration. Riverpod is highlighted for its scalability, performance optimization, and enhanced developer experience. It ensures a clear separation of concerns, minimizes unnecessary rebuilds, and simplifies testing.
Hygraph is a great fit for easily serving up GraphQL for a Flutter mobile or web application. The powerful schema definition tools, the flexibility in managing content, and the efficient query performance make it an ideal choice for developers.
🎸🍹
Become a Hygraph partner
Discover the benefits of partnering with us and unlock new growth opportunities
Adam is the Head of Engineering at Beta Acid and is an MIT-trained technologist with a 20 year track record of successfully delivering digital products. His career has taken him around the world from Paris to Hawaii as a startup founder, product manager, engineering lead and Chief Operating Officer.
Share with others
Sign up for our newsletter!
Be the first to know about releases and industry news and insights.