FLUTTER ECOSYSTEM

gql_code_builder

Dart code builders taking *.graphql documents and SDL to build useful classes.

Latest version
0.15.2
30-day downloads
352K
Likes
5
Pub points
130

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

gql_code_builder is a Dart code generation package that transforms GraphQL schema definitions (SDL) and query documents into type-safe Dart classes. It enables developers to generate models, queries, mutations, and variables directly from .graphql files, improving code maintainability and reducing boilerplate. By leveraging the power of build_runner, it integrates seamlessly into Flutter and Dart projects, ensuring strong typing and compile-time safety for GraphQL operations. The generated code supports both client-side and server-side use cases with minimal manual effort.

Use cases
  • Generating type-safe GraphQL queries
  • Automating model creation from SDL
  • Reducing boilerplate in GraphQL clients
  • Enabling compile-time validation of queries
  • Integrating with build_runner workflows
Key features
  • Generates Dart classes from .graphql files
  • Supports SDL and query document parsing
  • Produces type-safe models and operations
  • Integrates with build_runner
  • Offers extensible code generation hooks
Suitable for
  • Flutter apps using GraphQL
  • Dart projects requiring strong typing
  • Teams prioritizing code quality and maintainability
  • GraphQL clients needing automated code generation
  • Projects using gql-dart ecosystem
Considerations
  • Requires build_runner setup
  • Limited to static schema analysis
  • May increase build time
  • Not suitable for runtime schema changes
  • Dependent on correct GraphQL syntax in source files
Supported platformsNot available

Install package

flutter pub add gql_code_builder

Categories

Dependencies

Dependency list 10 items

Source repository

Related projects