Skip to content

Typegen produces result: unknown when warehouse query fails #244

@jamesbroadhead

Description

@jamesbroadhead

Summary

When appkit generate-types fails to execute a query against the warehouse (e.g. format incompatibility, stale session), it generates result: unknown in appKitTypes.d.ts instead of failing the build. This causes TypeScript compilation errors in components that depend on the generated types (Property 'length' does not exist on type '{}').

Reproduction

  1. Have a query file revenue_by_destination.sql in config/queries/
  2. The warehouse rejects the typegen query (format error, session timeout, etc.)
  3. Typegen shows ✓ revenue_by_destination (success!) but generates: result: unknown
  4. tsc fails because components expect data to be an array

Expected behavior

Either:

  • Typegen should fail the build when it can't determine result types
  • Or typegen should preserve the previous good types instead of overwriting with unknown
  • At minimum, typegen should show (failure) when it produces unknown types

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