Skip to content
pubscout

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.

WASM-readyQuiet but busy
$ flutter pub add ferry
Source repository

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.

  • graphql

    A Dart GraphQL client offering queries, mutations, subscriptions and cache management.

  • graphql_codegen

    Generate Dart serializers and client helpers from GraphQL queries and schemas.

  • nhost_graphql_adapter

    Adapter that connects the graphql package to an Nhost.io GraphQL backend

Works with

Packages commonly used together with ferry: ones it builds on, ones built on it, and its own family.