Skip to content

feat(parser): RTK Query extractor (6F.4)#46

Merged
officialCodeWork merged 1 commit into
developmentfrom
build/phase-6f/step-6f.4-rtk-query
Jul 15, 2026
Merged

feat(parser): RTK Query extractor (6F.4)#46
officialCodeWork merged 1 commit into
developmentfrom
build/phase-6f/step-6f.4-rtk-query

Conversation

@officialCodeWork

Copy link
Copy Markdown
Owner

Summary

The field validation found ~40 injectEndpoints files under src/store/api/** and 0 data-source nodes — the entire server-data dimension was invisible on a Redux Toolkit app. This PR adds the RTK Query extractor:

  • createApi / api.injectEndpoints recognition — the receiver resolves back to its createApi base through imports and chained injectEndpoints hops; the fetchBaseQuery baseUrl joins every endpoint
  • builder.query / builder.mutationDataSourceNodes: string-form and object-form ({ url, method }) configs, template params normalized to :param (POST /api/invoices/:id/pay)
  • Generated hooks (useGetUsersQuery, usePayInvoiceMutation, useLazy…Query) registered and wired to fetches-from edges at component call sites, so trace_lineage from a consuming component reaches its endpoint
  • New rtk-query DataSourceKind in core; schema regenerated (drift gate green)

Result on the field-patterns fixture

3 data sources extracted; both 6F.4 attribution xfails removed and passing (UsersPage → /api/users, InvoicesPage → /api/invoices). Remaining 5 xfails are all owned by 6F.5 (object-config routes).

Verification

  • pnpm test: 205 tests green (4 new)
  • pnpm eval: 285 pass · 0 fail · 5 xfail · 0 unexpected-pass, gate OK, metrics 1.000
  • pnpm typecheck: clean

🤖 Generated with Claude Code

…ts as data sources (6F.4)

The field run had ~40 injectEndpoints files under src/store/api/** and 0
data-source nodes: the entire server-cache dimension was invisible.

- New "rtk-query" DataSourceKind in core (schema regenerated).
- detectStores recognizes createApi and api.injectEndpoints declarations:
  rtkBaseCall resolves the (possibly imported) receiver back to its createApi
  through chained injectEndpoints hops; rtkBaseUrl reads the fetchBaseQuery
  baseUrl; every builder.query|mutation becomes a DataSourceNode — string-form
  and object-form ({ url, method }) query configs, template params normalized
  to :param form, baseUrl joined.
- Generated hooks (useXQuery, useXMutation, useLazyXQuery) register in a new
  rtkHooks map; the component body walk wires fetches-from edges at call
  sites, so traceLineage from a consuming component reaches its endpoint.

Fixture: 3 data sources (GET /api/users, GET /api/invoices,
POST /api/invoices/:id/pay); both 6F.4 attribution xfails removed and passing.

4 new parser tests (205 total across packages). Eval 285 pass / 0 fail /
5 xfail (all owned by 6F.5) / 0 unexpected-pass, gate OK, metrics 1.000.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@officialCodeWork
officialCodeWork merged commit 3efa3a1 into development Jul 15, 2026
1 check passed
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