ferry
0.16.1+2, released 2 years ago by gql-dart.dev
A GraphQL client for Dart and Flutter with code generation and normalized caching.
What it does
Ferry is a GraphQL client that generates immutable data classes and provides typed cache reads and writes. It supports customizable network links, normalized optimistic caching with local persistence, pagination, and Flutter widgets for queries, mutations, and subscriptions.
AI-written summary of version 0.16.1+2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You are building a Flutter or Dart app that communicates with a GraphQL API.
- You need compile-time type safety for GraphQL operations, fragments, and cache updates.
- You require a normalized cache with offline persistence using Hive.
Skip it when
- Your project uses REST instead of GraphQL.
- You want to avoid build-time code generation for your models.
Strengths
- Fully typed responses, operations, fragments, and cache reads/writes.
- Built-in code generators for immutable data classes.
- Normalized optimistic cache with offline persistence support via Hive.
Weaknesses
- Requires setting up build-runner and code generation.
- Higher initial setup complexity compared to lightweight HTTP clients.
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 11
Requires code generation setup (build_runner) for generating operations and fragments based on your schema.
final client = Client(
link: link,
cache: cache,
);Alternatives
Packages that do the same job and could replace ferry.
- sentry_link
Automatic capture of exceptions and GraphQL errors for the gql ecosystem like graphql and ferry.
86Compare - graphql
A Dart GraphQL client offering queries, mutations, subscriptions and cache management.
79Compare - graphql_codegen
Generate Dart serializers and client helpers from GraphQL queries and schemas.
78Compare - nhost_graphql_adapter
Adapter that connects the graphql package to an Nhost.io GraphQL backend
77Compare
Works with
Packages commonly used together with ferry: ones it builds on, ones built on it, and its own family.
- built_valueferry depends on itImmutable value types with builders, enum classes and JSON serialization for Dart.
- rxdartferry depends on itImplementation of the ReactiveX API for asynchronous programming leveraging native Dart Streams.
- hiveferry depends on itFast, pure Dart key-value store with optional AES-256 encryption
- gqlferry depends on itParse, transform and print GraphQL documents in Dart.
- normalizeferry depends on itNormalizes and denormalizes GraphQL responses to a cache-friendly map structure.
- gql_linkferry depends on itModular AST-based GraphQL request execution interface.
- gql_http_linkSame familyHTTP link for executing GraphQL requests via JSON.
- gql_code_builderSame familyDart code builder generating typed classes from GraphQL documents and SDL