zino-hofmann/graphql-flutter
51.8
Adequate · 5 August 2026
8.4k
lines of production code
Dart
primary language
4
measurements over time
What this system is
This system is a GraphQL client library and its Flutter integration, designed to manage data fetching, mutations, and subscriptions with robust state management. It provides a comprehensive API for handling HTTP and WebSocket transport, including request cancellation, polling, and caching with persistent storage support. The library also offers Flutter-specific widgets and hooks for declarative UI updates, alongside extensive tooling and examples for development and testing.
How it got here
2018–2019 — GraphQL client refactoring and Flutter hooks
28 changes.
This period focused on a comprehensive refactor of the GraphQL client, introducing a new cache architecture, request cancellation, and structured options. The Flutter package was significantly enhanced with React-style hooks and new widgets to simplify state management. Additionally, the project adopted a monorepo structure and standardized development tooling.
2020–2026 — Flutter hooks and modernized links
8 changes.
This period focused on modernizing the GraphQL client with Flutter Hooks for declarative data fetching and a new WebSocket link supporting the graphql-transport-ws protocol. The team also expanded test coverage for the cache and widget components, while adding a runnable GitHub API example to demonstrate these new capabilities.
Features
Add CancellableHttpLink for HTTP request cancellation
The graphql package now includes a new CancellableHttpLink that supports request cancellation via a CancellationToken. This allows in-flight HTTP requests to be aborted when a cancellation token fires, enabling better control over long-running queries and mutations. The link mirrors the functionality of the standard HttpLink but adds support for true network-level cancellation on all platforms.
packages/graphql · high confidence
Add GitHub GraphQL API example with CLI entry point
The example package now includes a complete, runnable demonstration of the GitHub GraphQL API. A new CLI entry point (bin/example.dart) allows users to execute queries and mutations via command-line arguments, supporting actions like fetching repositories, starring, and unstarring repositories. The core logic is provided in lib/main.dart, which implements the GraphQL client setup and mutation/query functions, while lib/local.dart provides a placeholder for the required personal access token.
packages/graphql/example/lib · high confidence
Add GraphQL BLoC example demonstrating state management with streams
A new example application was added to the graphql\_flutter package, located in packages/graphql\_flutter/example/lib/graphql\_bloc. It implements the BLoC (Business Logic Component) pattern using RxDart BehaviorSubjects to manage the state of a GitHub repository list. The example showcases how to handle queries, mutations, and loading states within a Flutter widget tree using StreamBuilders.
_packages/graphql\_flutter/example/lib/graphql\bloc · high confidence
Add cancellation example and stricter analysis options
The graphql\_flutter package now includes a new example demonstrating request cancellation using CancellableHttpLink, showing how to abort HTTP requests at the network level. Additionally, the package enforces stricter static analysis rules (strict-casts, strict-inference, strict-raw-types) to improve code quality and catch potential issues early.
_packages/graphql\flutter · high confidence
Add contributor tracking and development tooling
The repository now includes \.all-contributorsrc\ to automatically track and display community contributions in the README, alongside new configuration files (\.codecov.yml\, \melos.yaml\, \Makefile\, \cloudbuild.yaml\) and a \changelog-v3-v4.md\ migration guide to standardize development workflows and CI/CD processes.
(repo-wide) · high confidence
Add fetchMore pagination example for GraphQL Flutter
The example app now includes a new 'fetchMore' page that demonstrates how to implement pagination using the FetchMore API. The example shows how to handle query results, manage loading states, and update the cache with new data when the user triggers a 'Load More' action.
_packages/graphql\flutter/example/lib/fetchmore · high confidence
Added Flutter-specific Hive initialization utility
A new \initHiveForFlutter\ function has been added to \hive\_init.dart\ to handle Flutter-specific setup for Hive. This utility ensures the Flutter binding is initialized and, on non-web platforms, locates the application documents directory to initialize the Hive store. It also concurrently opens specified boxes, providing a convenient way for Flutter apps to set up Hive storage.
_packages/graphql\flutter/lib/src · high confidence
Added example app entry point
A new main.dart file has been added to the example directory, establishing the entry point for the example application.
example · high confidence
Introduce Flutter Hooks for GraphQL operations
Added new Flutter hooks (useQuery, useMutation, useSubscription, useWatchQuery) that provide a React-style API for GraphQL operations. These hooks manage the lifecycle of GraphQL clients and queries, including automatic subscription management and network connectivity handling for subscriptions. This allows Flutter developers to use declarative hooks for data fetching and mutations, replacing previous imperative or widget-based patterns.
_packages/graphql\flutter/lib/src/widgets/hooks · high confidence
Introduce Flutter widgets and hooks for GraphQL operations
Added new Flutter widgets (Query, Mutation, Subscription) and a provider/consumer pattern (GraphQLProvider, GraphQLConsumer, CacheProvider) to manage GraphQL client state in the widget tree. The implementation leverages Flutter hooks (flutter\_hooks) to handle state management and stream subscriptions, with a new ResultAccumulator widget to aggregate subscription results. This change decouples the GraphQL client from the widget layer, allowing for more flexible state management and easier integration with Flutter's reactive UI model.
_packages/graphql\flutter/lib/src/widgets · high confidence
Introduce new WebSocket client and link implementation
The library now provides a modernized WebSocket implementation in \packages/graphql/lib/src/links/websocket\_link\. This includes a new \SocketClient\ and \WebSocketLink\ classes that support the \graphql-transport-ws\ protocol, allowing for custom headers, auto-reconnection, and ping/pong keep-alive messages. The previous \SocketSubProtocol\ enum is deprecated in favor of the new \GraphQLProtocol\ class, and the client now uses \web\_socket\_channel\ for the underlying connection.
_packages/graphql/lib/src/links/websocket\link · high confidence
Introduces structured options, policies, and cancellation support for GraphQL operations
The core library now uses a unified \BaseOptions\ class to manage query and mutation configurations, introducing a \Policies\ container for \FetchPolicy\, \ErrorPolicy\, and \CacheRereadPolicy\. This change adds support for cancelling in-flight operations via \CancellationToken\, allows custom deep-equality functions for cache comparisons, and provides new helper methods like \isQuery\ and \isMutation\ on options. Additionally, \QueryResult\ now tracks its source (e.g., cache, network, optimistic) to better inform UI updates and error handling.
packages/graphql/lib/src/core · high confidence
New Flutter hooks and Hive initialization exposed in main entry point
The main entry point for the package now exports a set of new React-style hooks (mutation, query, subscription, and watchQuery) alongside the existing widget-based API, and exposes a Hive initialization helper for Flutter. Users can now import these hooks directly from the package's main library file, simplifying state management in Flutter apps that prefer hooks over widgets.
_packages/graphql\flutter/lib · high confidence
New QueryScheduler for optimized polling
A new QueryScheduler class has been introduced to manage polling intervals for queries. This component groups queries by their polling interval to optimize timer usage, ensuring that multiple queries with the same interval share a single timer. It also supports a deduplication mode where only the fastest polling query for a given request is kept active, reducing redundant network traffic.
packages/graphql/lib/src/scheduler · high confidence
New authentication and link handling components
Added a new AuthLink component that automatically attaches an authorization header to GraphQL requests using a provided token getter. Also introduced a set of reusable links (HTTP, error handling, deduplication) from the gql library, and a cancellable HTTP link to support query and mutation cancellation.
packages/graphql/lib/src/links · high confidence
New example app structure with cancellation and pagination demos
The GraphQL Flutter example app has been restructured to include a cancellation demo and a fetch-more (pagination) example, alongside existing BloC and widget pattern demos. A new helpers.dart file provides a reusable utility for handling loading and exception states in GraphQL queries, improving the consistency of error and loading UI across examples.
_packages/graphql\flutter/example/lib · high confidence
Star Wars example now supports web and mobile platforms
The Star Wars demo application has been restructured and expanded to support both mobile (Android/iOS) and web platforms. This change adds the necessary platform-specific configuration files (such as Android manifests, iOS settings, and web entry points) to enable the example to run on all supported Flutter targets. Users can now run the demo on the web using \flutter run -d chrome\ or on mobile devices, with the app correctly handling host addresses for local development across platforms.
examples/starwars · high confidence
Removals
Removed legacy Calculator class from lib/graphql.dart
The lib/graphql.dart file has been removed, eliminating the Calculator class and its addOne method from the public API.
lib · high confidence
Behavioural changes
Complete cache overhaul with strict write policies and Hive persistence
The cache implementation has been completely rewritten to use a new \NormalizingDataProxy\ architecture that enforces strict data structures on writes, throwing \PartialDataException\ or \CacheMisconfigurationException\ when data is invalid. This change introduces a configurable \PartialDataCachePolicy\ to control how partial data is handled, and adds support for optimistic transactions via \recordOptimisticTransaction\. Additionally, the cache now supports persistent storage through a new \HiveStore\ implementation, allowing the cache to be saved to disk.
packages/graphql/lib/src/cache · high confidence
Example project configuration and documentation updated
The example app now includes a .gitignore file to exclude build artifacts and IDE files, a .metadata file tracking the Flutter beta channel, and a README.md explaining the Github API wrapper example. Additionally, the example's analysis\_options.yaml has been updated to use the pedantic style for consistent code analysis.
_packages/graphql\flutter/example · high confidence
GraphQL client refactored with configurable timeout and policies
The GraphQL client has been refactored to support configurable request timeouts and default policies. Users can now specify a \queryRequestTimeout\ duration when creating the client or via options, allowing control over how long queries wait for a response. Additionally, the client now uses a \DefaultPolicies\ class to manage default settings for queries, mutations, and subscriptions, providing a more structured way to configure client behavior.
packages/graphql/lib/src · high confidence
New GraphQL utility functions for deep merging, variable sanitization, and response mapping
The graphql package introduces new utility functions in the \utilities\ directory to improve data handling and error management. \deeplyMergeLeft\ provides a way to deeply merge nested maps, which is essential for cache normalization. \variableSanitizer\ and \sanitizeFilesForCache\ allow safe serialization of complex types like \MultipartFile\ into the cache. Additionally, \optimizedDeepEquals\ offers a faster deep equality check for cache comparisons, and \mapFetchResultToQueryResult\ maps HTTP responses to \QueryResult\ objects, correctly handling different error policies (\all\, \ignore\, \none\) to determine whether to include data or errors in the result.
packages/graphql/lib/src/utilities · medium confidence
Re-export core GraphQL components and links from the main library entry point
The main library entry point (client.dart) now explicitly exports the cache, core types (including QueryResult and policies), exceptions, the GraphQLClient, and all link implementations. This allows users to import a single package to access all primary GraphQL functionality without needing to import individual sub-libraries or internal paths.
packages/graphql/lib · high confidence
Refactored exception hierarchy to use gql\_link types
The library's exception handling has been refactored to align with the \gql\_link\ ecosystem. A new set of exception classes—including \CancelledException\, \CacheMissException\, \CacheMisconfigurationException\, \MismatchedDataStructureException\, \UnexpectedResponseStructureException\, and \UnknownException\—now extend \LinkException\ rather than the previous base classes. This change introduces stricter type checking for network, cache, and unhandled client-side errors, providing more specific error types for different failure scenarios such as missing cache entries or malformed data structures.
packages/graphql/lib/src/exceptions · medium confidence
Updated Android example app configuration and assets
The Android example app for graphql\_flutter has been migrated to the V2 Flutter embedding, featuring updated AndroidManifest.xml files with INTERNET permissions, a Kotlin MainActivity extending FlutterActivity, and standard launch/normal themes for light and dark modes. Additionally, the example project now includes a web entry point (index.html) and a PWA manifest (manifest.json) to support web builds.
_packages/graphql\flutter/example/android · high confidence
Updated GraphQL Flutter example to use AST-based queries and modern mutation updates
The example application in packages/graphql\_flutter/example/lib/graphql\_widget has been migrated to use the \gql\ parser for converting GraphQL strings into AST documents, replacing the previous string-based query approach. The example also demonstrates the updated \MutationOptions\ API, including the use of the \update\ callback for cache updates and \onError\/\onCompleted\ callbacks for handling mutation results, reflecting the library's shift towards AST-based document handling and improved error handling.
_packages/graphql\_flutter/example/lib/graphql\widget · medium confidence
Updated GraphQL operation examples for Flutter
The example application's GraphQL operations have been updated to reflect current API structures. Mutations for adding and removing stars are now defined in separate files (addStar.dart, removeStar.dart) and exported via a mutations.dart barrel file. Queries for reading and searching repositories have been restructured, with the search query now including pagination details (pageInfo) and repository metadata (stargazers, forks, updatedAt). A test subscription for device changes has also been added.
_packages/graphql\_flutter/example/lib/graphql\operation · medium confidence
Updated iOS project files for the Flutter example
The iOS project files for the graphql\_flutter example have been updated to align with the latest Flutter tooling standards. This includes new or regenerated configuration files such as AppFrameworkInfo.plist, Debug/Release.xcconfig, and the Xcode project structure (project.pbxproj, schemes, and workspace settings). These changes ensure the example app builds correctly with modern Xcode and Flutter versions, resolving build issues and standardizing the iOS configuration.
_packages/graphql\flutter/example/ios · high confidence
Fixes
Restored iOS build configuration for the Star Wars example
The Star Wars example's iOS project files were rebuilt to ensure the example builds and runs correctly on iOS. This includes adding the necessary Xcode project structure, build configurations, and asset catalogs required for the Flutter application to launch on iOS devices.
examples/starwars/ios · high confidence
Test coverage
Added comprehensive test coverage for the GraphQL client; Added initial widget test for GraphQLConsumer; Added local test server for cancellation demo; Added tests for GraphQL cache and store implementations; Added widget tests for Query and Subscription components; Removal of obsolete unit tests.
Dependencies
Updated Dart and Flutter dependencies for the GraphQL client and Flutter packages
The \graphql\ and \graphql\_flutter\ packages have been updated to use newer versions of their dependencies, including \gql\ 1.0.0, \gql\_exec\ 1.0.0, \gql\_link\ 1.0.0, \gql\_http\_link\ 1.0.0, \gql\_transform\_link\ 1.0.0, \gql\_error\_link\ 1.0.0, \gql\_dedupe\_link\ 2.0.3, \hive\_ce\ 2.11.0/2.13.2, \http\ 1.6.0/1.1.0, \connectivity\_plus\ 7.0.0, and \flutter\_hooks\ 0.18.2-0.22.0. The root \pubspec.yaml\ and \pubspec.lock\ files have been removed as the project structure has shifted to a monorepo with separate packages. The \starwars\ example and \graphql\_flutter\ example have been updated to reflect these dependency changes, with the \starwars\ example now using \graphql\ ^5.1.2-beta.1 and \graphql\_flutter\ from a local path, while the \graphql\_flutter\ example uses \graphql\_flutter\ from a local path and \http\ ^1.1.0.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 52 → 52 (+0.0)
- Rubric changed (rubric-2026.08.18 → rubric-2026.08.19) — scores are not directly comparable.
Lenses
- Code Health 100 → 100 (+0.0)
- Architecture 100 → 100 (+0.0)
- Maturity 58 → 58 (+0.0)
- Readiness 50 → 50 (+0.0)
- Security 36 → 36 (+0.0)
- Domain Modelling 100 → 100 (+0.0)
Resolved (2)
- Off-boarding risk: anonymized user #1
- The We're Hiring! link points to hire.toggl.com but the project homepage is at github.com/zino-hofmann/graphql-flutter; this could mislead readers. (README.md)
New (1)
- Off-boarding risk: anonymized user #1
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
zino-hofmann/graphql-flutter was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 5 August 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit f490f57fe3ecb2307d0e6cb2424607316311bded — the exact code this score is about.
- Scored under rubric-2026.08.19 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer latest.