Skip to content

Schema config param is not fully compatible with GQLCodeGen; Improper caching of complex schemas #649

@comp615

Description

@comp615

GQLCodeGen supports several formats for the schema files used to do codegen. This include formats like remote URLs or TS/JS files that generate the schema.

The way Graphql-Let works today, its config is more or less directly passed through to the underlying GQLCodeGen CLI. This means that if you set your config to something like a remote file or TS file, the schema will actually be correctly generated.

The problem arises when you change that schema and re-run codegen. Before the config is passed through to the underlying CLI, graphql-let does some hashing / processing on it to determine if it should be run. The issue is that specific processing only handles literal files. If you browse the code, you can see there's a TODO and it filters out URLs. For TS/JS files...it can be very misleading because it will work, but it will actually hash the file itself (not the result of running the file which actually makes the schema)

This both:

  • Leads to situations where caching is improperly handled and does not appear to regenerate
  • Decreases overall API compatibility with CodeGen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions