Skip to content
pubscout

gql_build

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

Useful builders for your GraphQL SDL and documents.

$ flutter pub add gql_build
Source repository

What it does

Generates Dart code from GraphQL source, including AST representations, typed data views, variable classes, schema data classes, and built_value serializers.

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

Use it when

  • You want type-safe GraphQL requests and responses in Dart or Flutter
  • You use build_runner and want to automatically generate GraphQL models and serializers

Skip it when

  • You do not use code generation or build_runner in your project
  • Your project does not use GraphQL

Strengths

  • Provides multiple specialized builders like ast_builder, data_builder, var_builder, schema_builder, and serializer_builder
  • Supports tristate optionals to distinguish between absent, null, and non-null values
  • Customizable scalar type overrides and enum fallbacks

Weaknesses

  • Requires setting up build_runner and code generation steps
  • Relies on external code generation dependencies and built_value infrastructure

Setup

Kind
Pure Dart
Effort
Medium
Code generation
No
Direct dependencies
15

Requires adding the package and build_runner to dev_dependencies and configuring a build.yaml file for code generation.

tristate_optionals: true

Alternatives

Packages that do the same job and could replace gql_build.

Works with

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