Skip to content

Read the thread indicator as a standard variable (#106) - #135

Merged
mosoriob merged 2 commits into
developfrom
fix/106-indicator-standard-variable
Aug 30, 2026
Merged

mosoriob merged 2 commits into
developfrom
fix/106-indicator-standard-variable

Conversation

@mosoriob

@mosoriob mosoriob commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

The client half of #106. The schema half is
mintproject/graphql_engine#15, which repoints
thread.response_variable_id and task.response_variable_id (and both driving
variable columns) at modelcatalog_standard_variable.

What changes here

After the repoint the stored id is a URI such as
https://w3id.org/okn/i/mint/DRAWDOWN, and the response_variable relationship
resolves to a standard variable, which has a label, not a name.

  • GetThread selected driving_variable { id name } and
    response_variable { id name }. name does not exist on
    modelcatalog_standard_variable, so the whole query would have failed and the
    thread page with it. Both now select label.
  • Four places printed the raw stored id and would have shown the URI: the
    Variables step combobox trigger, the thread summary, the thread expansion
    panel, and the wizard step summary. All four now prefer the label and fall
    back to the id.
  • generated/schema.graphql and generated/graphql.ts are regenerated against
    a Hasura carrying the migration. The whole diff is the relationship move; no
    type is added or removed, so the dev schema and the committed one agree on
    everything else.

VariablesStep already wrote the standard variable id, so the write path is
unchanged — it just stops failing.

Order of deployment

This is safe to merge before the migration but must not ship to a Hasura that
still has the old constraint: label would not resolve. Merge
mintproject/graphql_engine#15 and apply the migration first.

Verified

  • npx vitest run — 103 files pass, including two new tests: the stored
    indicator shows by label, and falls back to the URI when no label is carried.
  • npm run build, npm run lint (0 errors), prettier --check clean.
  • Live against the MicroK8s dev cluster with the migration applied:
    thread.response_variable resolves to modelcatalog_standard_variable and
    returns { id: ".../TOTAL_WATER_STORAGE", label: "total_water_storage" }.
    Writing a URI succeeds; writing the bare drawdown is now the one refused.

The Variables step writes a standard variable URI to thread.response_variable_id.
graphql_engine repoints the foreign key at modelcatalog_standard_variable, so the
relationship now resolves there and carries a label instead of a name.

Every place that showed the raw stored id -- the combobox trigger, the thread
summary, the expansion panel and the wizard step summary -- would otherwise show
the URI. They now prefer the label and fall back to the id.
@vercel

vercel Bot commented Aug 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
monorepo Ready Ready Preview Aug 30, 2026 12:25am

Run against the dev cluster with the #106 migration applied. The whole diff is
the relationship move: thread and task driving/response variables now resolve to
modelcatalog_standard_variable, and the four array relationships move with them.
No type is added or removed.

This branch was successfully deployed

1 active deployment
Preview — fae21856 Deployed Aug 30, 2026 by vercel[bot]
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.

1 participant