Skip to content

Incremental Code Generation for Large Schemas #4041

Description

@jhonDoe15

Problem

For large GraphQL schemas (1000+ types), gqlgen regenerates all code on every run, even when only a subset of schema files have changed. This leads to:

Unnecessary file rewrites - Files are rewritten even when content is identical, invalidating Go's build cache
Long rebuild times - Go recompiles the entire generated package (~1M+ lines) because file mtimes changed
Poor developer experience - Small schema changes trigger full multiple-minute rebuilds

Proposed Solution

Build a dependency graph tracking which types are defined in which schema files. When specific schemas change, compute the transitive closure of affected schemas and only regenerate those files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions