Skip to content

Subscription payload/argument types are referenced but never emitted in the generated schema #343

Description

@izumin5210

Summary

Interfaces used as defineSubscription generics are referenced by name in the generated schema but never extracted/emitted as type definitions, producing schemas that reference undefined types.

Evidence

The committed goldens of subscription-only, subscription-mixed, subscription-directives-tsdoc, import-extension-none, and import-extension-ts (packages/cli/src/gen-orchestrator/testdata/) contain fields typed Event! / Message! / User! with no corresponding type definition in the same schema.graphql. graphql-js's buildASTSchema rejects these schemas with "Unknown type".

gqlkit's own pipeline never runs strict SDL validation, so this ships silently today. Any downstream consumer that round-trips the SDL through graphql-js (or uses makeExecutableSchema with strict validation) will fail.

Origin

Plain interfaces consumed only as defineSubscription<Args, Payload> type arguments are resolved by name (they land in the schema as references) but never go through type extraction as declarations.

Context

Discovered during the refactoring plan's Phase 6 pruning survey (.kiro/specs/refactor-plan.md, Phase 6 execution note), where enabling buildASTSchema-based pruning crashed on exactly these cases. Deliberately not fixed in that PR (out of scope). The Phase 9 resolver-side type-reference validation work (Decision D6) is the natural home for at least detecting this as a diagnostic.

🤖 Generated with Claude Code

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