feat(api): GraphQL search_index filter/sort/page parity#8051
Conversation
Reuse loadSearchIndexList so search_index accepts type/netuid/q/sort/order with the same pagination meta as REST and MCP. Closes JSONbored#7877. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8051 +/- ##
==========================================
- Coverage 97.67% 97.67% -0.01%
==========================================
Files 220 220
Lines 27230 27229 -1
Branches 10800 10800
==========================================
- Hits 26598 26597 -1
Misses 140 140
Partials 492 492
🚀 New features to boost your workflow:
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-24 21:01:50 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.
|
Summary
Adds
type,netuid,q,sort, andorderto the GraphQLsearch_indexfield so it matcheslist_search_index/GET /api/v1/search-index.Closes #7877
Why previous PRs were closed
checks,test) — auto-closedchecks) — auto-closedDIRTY) — CI green, review approved; gate could not mergeReimplementation on a fresh branch off current
main(no competing open PR). SDL lives ingraphql-sdl.ts(split from the monolithic file #8012 targeted).What changed (4 files)
src/graphql-sdl.tssearch_indexargs:type,netuid,q,sort,order,limit,cursor(cursor: Int, matching REST/MCP)SearchIndexListreturn type with full list-query pagination meta (returned/limit/cursor/next_cursor/sort/order/generated_at)src/graphql.tsloadSearchIndexList(same loader MCPlist_search_index+ REST already use) — no local filter logicgenerated/graphql/types.tsnpm run build:graphql-types)tests/graphql.test.tsnext_cursorqfilter testtype+netuidAND-combination testValidation
vitest run tests/graphql.test.ts -t 'search_index'— 3/3 passedvitest run tests/graphql.test.ts -t 'discovery parity'— 16/16 passedcodecov/patch≥99%)Test plan
search_index(q: "…")narrows documents by keywordsearch_index(type: "subnet", netuid: N)combines filters with ANDsearch_index(limit: 1)returns integernext_cursorpaginationsort/type/limit/cursorsurface as GraphQL errors