搜索插件、代码仓与 APP 分类

插件详情v0.10.1

ferry_cache

用于 GraphQL 操作和片段的规范化、强类型化、乐观缓存

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
7.1万
喜欢数
4
Pub 分数
140

安装插件

flutter pub add ferry_cache

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Ferry Cache 是一个经过归一化、强类型且乐观的缓存解决方案,专为 GraphQL 操作和片段设计。它通过以结构化、去重的格式存储响应,确保高效的数据管理,减少冗余的网络请求。该缓存支持实时更新和乐观 UI 行为,在执行变更时提升用户体验。专为 GQL Dart 生态系统打造,可与 Ferry 无缝集成,实现跨多个平台的健壮客户端状态处理。

适合场景

  • 缓存 GraphQL 查询结果
  • 乐观的 UI 更新在变更之后
  • 跨组件管理归一化数据
  • 减少冗余的网络调用
  • 支持离线优先的应用程序
  • 在应用程序的不同部分之间同步状态

主要特点

  • 归一化数据存储
  • 缓存条目的强类型
  • 乐观更新
  • GraphQL 片段支持
  • 跨平台兼容性
  • 与渡轮的集成

适合对象

  • 使用 GraphQL 的 Dart/Flutter 应用
  • 需要类型安全缓存的开发人员
  • 需要实时数据同步的项目
  • 具有复杂嵌套数据结构的应用程序
  • 构建可扩展 GraphQL 客户端的团队

使用建议

  • 需要与渡轮集成
  • 限制为 GraphQL 工作流
  • 可能需要学习曲线来理解归一化概念
  • 依赖于 GQL Dart 生态系统
  • 不适用于非GraphQL数据源

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

A simple, powerful GraphQL Client for Flutter and Dart

MIT License PRs Welcome Watch on GitHub Star on GitHub Watch on GitHub Discord

Documentation 📖

Features

  1. ✅ Fully Typed: work faster and safer with compile time checks and IDE autocomplete, including fully typed Cache reads and writes.
  2. 🔄 Built-In Code Generators: automatically generated immutable data classes for all your GraphQL Operations and Fragments, based on your schema.
  3. 🌐 Customizable Network Interface: highly customizable network interface using gql_link, allowing you to compose and extend Links.
  4. ✨ Normalized Optimistic Cache: keep data in sync with cache normalization and update your UI instantly with optimistic data.
  5. 💾 Multiple Data Stores: extensible Store interface with built-in MemoryStore and HiveStore (which uses hive for offline persistence).
  6. 📄 Refetch & Pagination: easily update responses with new data or combine multiple responses, allowing for seamless pagination.
  7. 📱 Flutter Widgets: Widgets for Queries, Mutations, and Subscriptions, available out of the box.
  8. 🧈 Smooth: Run queries in a separate Isolate to free up resources on the UI thread

Packages

This repo is a monorepo for ferry and related packages.

Pub Package Description
version package:ferry Stream-based GraphQL Client
version package:ferry_cache Normalized, strongly typed, optimistic cache
version package:ferry_exec Strongly typed GraphQL execution interface
version package:ferry_flutter Flutter Widgets for GraphQL Operations
version package:ferry_generator Dart Type Generator for GraphQL Operations
version package:ferry_store Data Persistence for ferry's cache
version package:ferry_hive_store Hive implementation of ferry_store
version package:normalize Normalization / denormalization of GraphQL data

所属分类

依赖

依赖清单 7 项

源码仓库

使用此插件的项目

暂无相关数据。