FLUTTER ECOSYSTEM

graphql_codegen

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

Latest version
3.0.2
30-day downloads
203K
Likes
152
Pub points
160

Package Overview

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

Overview

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
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add graphql_codegen

Categories

Dependencies

Dependency list 10 items

Source repository

Related projects