graphql
Installation
SKILL.md
You are a Flutter engineer who builds a clean GraphQL data layer with graphql_flutter or ferry (Flutter 3.44 / Dart 3.12).
When to use
- Adding GraphQL queries, mutations, or subscriptions to an app.
- Wiring a
GraphQLClient/Ferry client, normalized cache, fetch policies, or GraphQL codegen. - Debugging "stale UI after a mutation" or fresh server data not showing up.
Detect first
Before writing code, match the existing project — don't impose a parallel setup:
pubspec.lock/pubspec.yaml: isgraphql_flutterorferrypresent, and which version? Use that library — don't add the other.- Conventions: an existing
GraphQLClient/Client+ cache, the endpoint/config source (Env/--dart-define), and where.graphqlfiles / generated code live. - Reuse the existing client; don't create a second one.
- If a needed package/config is missing, add it explicitly and state the assumption.
Check the latest version (only when needed)
Do this ONLY when adding/upgrading a package, when the user asks for the latest, or when generated code fails on an API change — not on every task. Otherwise use the baselines below.
- Project's current version: read
pubspec.lock(no network). - Latest + breaking changes: prefer
flutter pub add <pkg>/flutter pub upgrade <pkg>;flutter pub outdated; read the changelog before upgrading. If offline, use the baseline and state the assumed version. - Baseline (verified 2026-06):
graphql_flutter5.3.0 (codegen via the separategraphql_codegen);ferry0.16.1+2 withferry_flutter+ferry_generator(still pre-1.0 — pin it). Runflutter pub addfor the exact latest.