Skip to content

fix: excludedFields crash + skip_llm in GraphQL document#33

Merged
acmeguy merged 4 commits intomasterfrom
feat/map-field-opt-in-ui
Apr 18, 2026
Merged

fix: excludedFields crash + skip_llm in GraphQL document#33
acmeguy merged 4 commits intomasterfrom
feat/map-field-opt-in-ui

Conversation

@acmeguy
Copy link
Copy Markdown

@acmeguy acmeguy commented Apr 18, 2026

Summary

  • Compute excludedFields from selectedModelFields and changePreview — was referenced but never declared, causing ReferenceError that crashed the apply step
  • Add skip_llm variable to the generated GraphQL document in generated.ts — URQL was silently dropping it because the document didn't declare the variable

Root cause

Two undeclared variables in SmartGeneration component:

  1. excludedFields — used on apply but never computed from state
  2. skip_llm in generated.ts — codegen couldn't run (schema mismatches with other .gql files), so the document was stale

Tested

  • Full e2e via Playwright: profile -> skip LLM checked -> preview (no crash) -> apply (no crash) -> model created successfully

Test plan

  • Smart gen preview shows without JS crash
  • Apply with "Skip LLM" checked succeeds (no "unexpected variables" error)
  • Apply without "Skip LLM" also works

🤖 Generated with Claude Code

acmeguy and others added 4 commits March 31, 2026 09:00
Smart Generation UI improvements:
- Map, nested (ARRAY JOIN), and AI fields default to unchecked (opt-in)
- Count measure and required fields (rewrite rules + filters) always selected
- "Start Over" button on change preview step resets to table selection
- "Skip LLM enrichment" checkbox on column selection step
- AI metrics section starts unchecked (opt-in, not opt-out)
- AI metrics empty selection sends empty array to prevent backend include-all bug
- Source tag support in ChangeField interface (map, nested, ai)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The frontend checkbox existed but the GraphQL variable was never declared
in the mutation, so URQL silently dropped it. Now wired end-to-end.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
setSelectedModelFields was called on preview result and start-over
but never declared via useState, causing a ReferenceError that crashed
the smart gen UI and prevented models from being created.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… generated document

excludedFields was referenced but never declared, causing ReferenceError
that crashed the apply step — no models could be created.

Also add skip_llm variable declaration to the generated GraphQL document
so URQL actually sends it to Hasura (codegen couldn't run due to schema
mismatches, so the document was manually updated).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@acmeguy acmeguy merged commit 192eb85 into master Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants