Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when setting up Data Connect, writing GraphQL queries/mutations, configuring generated SDKs, handling offline, or applying security rules.
.claude/skills/evanca-firebase-data-connect/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | -3% | 0% |
| case-01 | ✓→✗ | ▼ Worse | -8% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 11% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 123% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 39% | 0% |
This skill defines how to correctly use Firebase Data Connect in Flutter applications.
Use this skill when:
flutter pub add firebase_data_connectdartimport '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.gqlgraphqltype Movie @table { id: UUID! @default(expr: "uuidV4()") title: String! releaseYear: Int genre: String rating: Float description: String }
dataconnect/connector/queries.gqlgraphqlquery 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 generateThis 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:
dart// 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:
dartfinal subscription = ListMoviesQuery().subscribe(); subscription.listen((result) { final movies = result.data.movies; // Update UI with latest movie list });
graphql 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:
darttry { 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).Other measured skills in the registry, with their headline benchmark lift.