Skip to content
pubscout

gql_code_builder

0.15.3, released 3 weeks ago by gql-dart.dev

Dart code builder generating typed classes from GraphQL documents and SDL

$ flutter pub add gql_code_builder
Source repository

What it does

Generates Dart code classes from GraphQL documents (.graphql) and GraphQL Schema Definition Language (SDL). It produces structured AST and source code definitions for variables, data classes, and serializers using code_builder. It primarily serves as the low-level foundation for build packages such as package:gql_build.

AI-written summary of version 0.15.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Building custom code-generation tools or custom builders for GraphQL documents and SDL in Dart
  • Developing higher-level GraphQL tools or integrating with package:gql_build

Skip it when

  • Needing an end-user code generation runner (use higher-level tools like package:gql_build instead)
  • Not working with GraphQL schemas or ASTs

Strengths

  • Integrates directly with code_builder and analyzer for fine-grained code generation
  • Supports advanced GraphQL features like fragment spreads, inline fragments, and tristate values (null vs absent)

Weaknesses

  • The API is explicitly unstable and intended primarily for internal use by package:gql_build
  • Documentation and examples are minimal in the package README

Setup

Kind
Pure Dart
Effort
Medium
Code generation
No
Direct dependencies
10

Requires setting up code generation infrastructure or integrating via build_runner and package:gql_build.

Alternatives

Packages that do the same job and could replace gql_code_builder.

Works with

Packages commonly used together with gql_code_builder: ones it builds on, ones built on it, and its own family.