Search packages, repositories and app categories

Package detailsv3.0.2

graphql_codegen

Simple, opinionated, codegen library for GraphQL. It allows you to generate serializers and client helpers to easily call and parse your data.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
163K
Likes
152
Pub points
160

Install package

flutter pub add graphql_codegen

Package Overview

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

graphql_codegen is a Flutter/Dart package that simplifies GraphQL integration by generating type-safe serializers and client helpers from your GraphQL queries. It streamlines data parsing and API calls, reducing boilerplate and improving development speed. Designed with simplicity and consistency in mind, it supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux. The code generation process ensures strong typing and reduces runtime errors. Ideal for teams using GraphQL with Dart, especially when maintaining large-scale applications.

Use cases

  • Generating type-safe GraphQL clients
  • Automating JSON serialization for GraphQL responses
  • Reducing boilerplate in GraphQL API interactions
  • Integrating GraphQL into multi-platform Flutter apps
  • Enabling faster development with auto-generated helpers
  • Simplifying query management in large projects

Key features

  • Auto-generates serializers from GraphQL queries
  • Produces type-safe Dart classes
  • Supports all Flutter platforms
  • Minimizes manual parsing logic
  • Integrates with existing GraphQL workflows
  • Offers opinionated, consistent code structure

Suitable for

  • Flutter developers using GraphQL
  • Teams prioritizing type safety
  • Projects requiring fast GraphQL integration
  • Apps targeting multiple platforms
  • Developers wanting to reduce boilerplate
  • Projects with frequent schema changes

Considerations

  • Requires GraphQL schema or queries to generate code
  • Depends on build_runner for code generation
  • May need configuration for complex schemas
  • Not suitable for dynamic or runtime queries
  • Best used with static GraphQL documents
  • Limited customization compared to manual implementations

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

GraphQL Codegen

This project contains a codegeneration tool for GraphQL in Dart. It allows you to generate type-safe Dart classes for your GraphQL operations.

It contains the following packages

You'll probably only need graphql_codegen.

Categories

Dependencies

Dependency list 10 items

Source repository

Projects using this package