Best for
- Setting up and configuring Firebase Data Connect in a Flutter project.
- Designing schemas, queries, and mutations for Data Connect.
- Implementing generated SDK calls for typed queries and mutations.
evanca/flutter-ai-rules/skills/firebase-data-connect/SKILL.md
Use when setting up Data Connect, writing GraphQL queries/mutations, configuring generated SDKs, handling offline, or applying security rules.
Decision brief
This skill defines how to correctly use Firebase Data Connect in Flutter applications.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/evanca/flutter-ai-rules --skill "skills/firebase-data-connect"Inspect the Agent Skill "firebase-data-connect" from https://github.com/evanca/flutter-ai-rules/blob/b294a77b68b5508f8d3151fb93d87ed9622d2ff1/skills/firebase-data-connect/SKILL.md at commit b294a77b68b5508f8d3151fb93d87ed9622d2ff1. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
This produces typed Dart classes for each query and mutation.
Review the “Step 1: Install the package” section in the pinned source before continuing.
Review the “Step 2: Import and initialize” section in the pinned source before continuing.
Review the “Step 3: Define a schema in dataconnect/schema/schema.gql” section in the pinned source before continuing.
Permission review
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 88/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 604 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
This skill defines how to correctly use Firebase Data Connect in Flutter applications.
Use this skill when:
flutter pub add firebase_data_connect
import 'package:firebase_data_connect/firebase_data_connect.dart';
import 'package:firebase_core/firebase_core.dart';
import 'firebase_options.dart';
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
dataconnect/schema/schema.gqltype Movie @table {
id: UUID! @default(expr: "uuidV4()")
title: String!
releaseYear: Int
genre: String
rating: Float
description: String
}
dataconnect/connector/queries.gqlquery ListMovies @auth(level: PUBLIC) {
movies {
id
title
releaseYear
genre
rating
}
}
mutation CreateMovie($title: String!, $releaseYear: Int, $genre: String) @auth(level: USER) {
movie_insert(data: {
title: $title
releaseYear: $releaseYear
genre: $genre
})
}
mutation DeleteMovie($id: UUID!) @auth(level: USER) {
movie_delete(id: $id)
}
flutterfire generate
This produces typed Dart classes for each query and mutation.
Platform support:
| Platform | Support |
|---|---|
| iOS | Full |
| Android | Full |
| Web | Full |
| Other platforms | Not supported |
Use the generated SDK to execute typed queries and mutations:
// Execute a query
final result = await ListMoviesQuery().execute();
final movies = result.data.movies;
// Execute a mutation
await CreateMovieMutation(title: 'Inception', releaseYear: 2010, genre: 'Sci-Fi')
.execute();
// Delete by ID
await DeleteMovieMutation(id: movieId).execute();
Subscribe to query changes for live updates:
final subscription = ListMoviesQuery().subscribe();
subscription.listen((result) {
final movies = result.data.movies;
// Update UI with latest movie list
});
query ListMoviesPaginated($limit: Int!, $offset: Int!) @auth(level: PUBLIC) {
movies(limit: $limit, offset: $offset) {
id
title
releaseYear
}
}
Wrap Data Connect calls in try/catch to handle network and validation errors:
try {
final result = await ListMoviesQuery().execute();
return result.data.movies;
} on FirebaseException catch (e) {
if (e.code == 'unavailable') {
// Handle offline — return cached data
return _localCache.getMovies();
}
rethrow;
}
@auth directives in schema to control access levels (PUBLIC, USER, NO_ACCESS).