refactor(api): type D-batch-1 GraphQL resolver args from generated types (#8158)#8174
refactor(api): type D-batch-1 GraphQL resolver args from generated types (#8158)#8174kai392 wants to merge 1 commit into
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…pes (JSONbored#8158) types-epic D (JSONbored#7862) batch 1: convert the 20 discovery & subnet-lifecycle Query-field resolvers in src/graphql.ts from Row-typed args to the generated Query<Field>Args types, following PR JSONbored#8005's pilot process. 16 of the fields declare SDL arguments and adopt their generated Args type; the 4 no-arg fields (agent_resources, curation, fixtures, freshness) already used an unknown args param (codegen emits no Args type for a no-argument field), so they satisfy the no-Row criterion unchanged. Step-2 mismatch check (per the issue): one real type-surface fix -- saved_query passes the SDL's opaque JSON params (typed unknown) to runSavedQuery, which takes Row; cast at the call site since runSavedQuery owns param coercion. No behavior change. No SDL change, so generated/graphql/types.ts is unchanged and the drift gate stays green. Closes JSONbored#8158
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8174 +/- ##
=======================================
Coverage 97.82% 97.82%
=======================================
Files 415 415
Lines 28893 28893
Branches 10850 10850
=======================================
Hits 28265 28265
Misses 141 141
Partials 487 487
🚀 New features to boost your workflow:
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-25 23:32:57 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
|
LoopOver is closing this pull request on the maintainer's behalf (Linked issue #8158 is assigned to the maintainer (@JSONbored) — that work is reserved for the maintainer, so this PR cannot be auto-accepted.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Closes #8158
Summary
types-epic D (#7862) batch 1 — converts the 20 discovery & subnet-lifecycle
Query-field resolvers insrc/graphql.tsfromRow-typedargsto the generatedQuery<Field>Argstypes, following the exact process PR #8005 established for the 5 pilot fields. Purely a resolver-argument typing change.What changed (1 file:
src/graphql.ts)Resolverswrapper — matching feat(types): types-epic D — GraphQL codegen from the SDL, pilot resolver adoption #8005, since thisrootValueuses graphql-js's(args, context, info)default-field-resolver convention):subnet_registrations,subnet_hyperparameters,subnet_hyperparameters_history,subnet_deregistrations,subnet_serving,subnet_health_trends,subnet_uptime,subnet_health_incidents,subnet_health_percentiles,subnet_volume,candidates,saved_query,fixture,agent_catalog,top_holders,search.agent_resources,curation,fixtures,freshness) — the SDL declares them with no arguments, so codegen emits noArgstype; they already used anunknownargs param, which already satisfies acceptance-criterion chore(deps): bump astral-sh/setup-uv from d0d8abe699bfb85fec6de9f7adb5ae17292296ff to d0cc045d04ccac9d8b7881df0226f9e82c39688e #1 (noargs: Row). Left unchanged.rootValuedeclaration updated to record batch 1 as done.Step-2 mismatch check
The issue requires actually reading each resolver for an SDL/resolver type mismatch. Found one real type-surface issue:
saved_queryhands the SDL's opaqueJSONparams(which codegen types asunknown) torunSavedQuery, whose 3rd param isRow. SincerunSavedQueryowns param coercion/validation, the value is cast toRowat the call site — no behavior change, and called out here per the issue's instruction. All other 15 fields converted with zero body changes.No generated-types / SDL change
No SDL edit in
src/graphql-sdl.ts, sogenerated/graphql/types.tsis unchanged andscripts/validate-graphql-types-drift.tsstays green (verified locally against the codegen output, EOL-normalized).Validation
npx tsc --noEmitclean, repo-wide.tests/graphql.test.tsgreen (1022 tests), unchanged.saved_querycast, is hit with both??branches taken).eslint+prettierclean.