Skip to content
This repository was archived by the owner on Sep 12, 2026. It is now read-only.

fix(queries): stop selecting response_variable through the relationship - #662

Open
mosoriob wants to merge 1 commit into
mainfrom
fix/thread-previews-schema-agnostic
Open

fix(queries): stop selecting response_variable through the relationship#662
mosoriob wants to merge 1 commit into
mainfrom
fix/thread-previews-schema-agnostic

Conversation

@mosoriob

Copy link
Copy Markdown
Contributor

Makes this app work against the schema on both sides of
monorepo#136, so the migration and the
TACC deployment stop being a timed pair.

The problem

thread_previews selected response_variable { name }. That relationship is
foreign_key_constraint_on, so it follows the constraint. monorepo#136 repoints the
constraint from public.variable to modelcatalog_standard_variable, which has label and
no name. Hasura then rejects the whole document at validation.

The fragment is pulled into problem_statement_info, so this is not one empty field. The
problem statement list, its get query and both subscriptions all stop working. The commit
deployed at mint.tacc.utexas.edu today, 888ec50, carries that selection.

Verified live, anonymously, on both endpoints

Fragment graphql.mint.tacc.utexas.edu (not migrated) graphql.mint.local (migrated)
this PR data data
main today data validation-failed

Cost

One cosmetic item. src/screens/modeling/actions.ts:361 fills problem["preview"], the
variable chips on a problem statement card. It already guards on
th.response_variable && th.response_variable.name, so it needs no change and the array is
now empty. At TACC 1 of 165 threads carries a response variable, so 164 cards look the
same as before.

No codegen runs in this repo and the consumer is any-typed, so nothing else needs updating.

Why now

This is option C on monorepo#136. The
alternatives both leave a window with no working UI, and they break the rollback for the
React cutover (monorepo#77), which keeps
this app deployed-but-unrouted as its only undo.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QwQXq4Y3Tx8NoHpY1tYjEh

thread_previews selected `response_variable { name }`. That relationship is
`foreign_key_constraint_on`, so it follows the constraint.
mintproject/monorepo#136 repoints the constraint to
modelcatalog_standard_variable, which has `label` and no `name`, and Hasura
then rejects the whole document at validation.

The fragment is pulled into problem_statement_info, so the failure is not
one empty field. The problem statement list, its get query and both
subscriptions all stop working.

Select the thread id instead. The fragment then validates on both sides of
that migration, so this app and the migration stop being a timed pair.

Verified live and anonymously against both endpoints. The new fragment
returns data from TACC, which is not migrated, and from the development
cluster, which is. The old fragment returns data from TACC and
validation-failed from the development cluster.

Cost: screens/modeling/actions.ts fills problem["preview"], the variable
chips on a problem statement card, from this selection. It already guards on
`th.response_variable && th.response_variable.name`, so it needs no change
and the array is now empty. At TACC 1 of 165 threads carries a response
variable, so 164 cards are unchanged.

Refs mintproject/monorepo#136, mintproject/monorepo#77
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant