Overview
Ferry Generator is a code generation tool for the Ferry GraphQL client, designed to create type-safe Dart classes from GraphQL operations. It simplifies working with GraphQL by automatically generating models, queries, mutations, and subscriptions based on schema and query files. This reduces boilerplate and minimizes runtime errors by ensuring types align with the GraphQL API. The generator integrates seamlessly into Flutter projects and supports multiple platforms including Android, iOS, macOS, Windows, and Linux.
Use cases
- Automatically generate GraphQL operation types
- Create type-safe models from GraphQL schema
- Simplify mutation and query handling in Flutter apps
- Enable compile-time validation of GraphQL operations
- Support cross-platform GraphQL clients
Key features
- Generates Dart classes from GraphQL files
- Ensures type safety for GraphQL operations
- Integrates with Ferry client
- Supports queries, mutations, and subscriptions
- Produces minimal boilerplate code
Suitable for
- Flutter developers using Ferry GraphQL client
- Teams prioritizing type safety in GraphQL usage
- Projects requiring efficient GraphQL code generation
- Apps targeting multiple platforms with shared GraphQL logic
- Developers seeking reduced manual code maintenance
Considerations
- Requires a GraphQL schema and operation files
- Depends on Ferry client for runtime functionality
- Needs proper setup in pubspec.yaml
- May require additional configuration for complex schemas
- Best used in conjunction with Ferry's runtime library