Skip to content

Add more metadata about codegen #1301

@scotttrinh

Description

@scotttrinh

When reviewing diffs in generated query.ts files, it's often unclear why changes occur especially when the output seems correct but differs between environments. Currently, we only track the @gel/generate version in the generated files, but two other factors can affect the output: the Gel server version and the current migration hash.

Problem:
Without this metadata, it's difficult to diagnose whether a diff is due to a code change, a different server version, or a migration state mismatch. This leads to confusion and extra investigation when reviewing generated code.

Proposal:

  • Add the Gel server version and (optionally) the current migration hash to the generated file metadata.
  • Consider moving this metadata to a separate file (e.g., a lock file) to reduce noise in diffs and make it easier to track which files were actually changed.
  • Optionally, include file content hashes in the metadata file to help identify stale or orphaned generated files.

Benefits:

  • Makes it easier to understand and audit changes in generated files.
  • Helps teams quickly identify environment mismatches or migration issues.
  • Reduces confusion and time spent investigating "mysterious" diffs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions