Skip to content

refactor(orgs): retire REST org service, migrate all callers to GQL#1322

Open
kevwilliams wants to merge 4 commits into
mainfrom
feat/graphql-phase2-org-consolidation
Open

refactor(orgs): retire REST org service, migrate all callers to GQL#1322
kevwilliams wants to merge 4 commits into
mainfrom
feat/graphql-phase2-org-consolidation

Conversation

@kevwilliams

Copy link
Copy Markdown
Contributor

Consolidates the dual-implementation pattern for organizations (Phase 2 of the GraphQL migration). Deletes the REST service and query hooks; all callers now use createOrganizationGqlService.

Changes

  • Delete organization.service.ts and organization.queries.ts
  • Move organizationKeys into organization.gql-service.ts
  • Add useOrganizations / useOrganization TanStack hooks backed by GQL (same signatures as retired REST hooks)
  • Migrate 6 SSR loaders and 3 CSR mutation hooks to GQL equivalents
  • Fix org adapter: coerce GQL nullundefined for namespace (z.string().optional() rejects null; GraphQL returns it for cluster-scoped resources)
  • Fix create/update mutations: add apiVersion+kind to request body (Kubernetes API requires them)
  • Remove unused REST session hooks from user.queries.ts

Notes

Users resource not fully retired — get/update/delete/updatePreferences/getUserIdentity have no GraphQL schema coverage yet.

Test plan

  • Create org
  • Update org name/description in settings
  • Delete org
  • /org/:orgId/projects loads without namespace validation error
  • /account/billing loads
  • Header org switcher populates

- Move organizationKeys into gql-service; delete organization.service.ts
  and organization.queries.ts
- Add useOrganizations / useOrganization TanStack hooks backed by GQL
  service (same signatures, no call-site changes needed)
- Migrate 6 SSR loaders and 3 CSR mutation hooks to GQL equivalents
- Fix org adapter: coerce GQL null → undefined for namespace
  (z.string().optional() rejects null; GraphQL returns it for
  cluster-scoped resources)
- Fix create/update mutations: add apiVersion+kind to request body
- Remove unused REST session hooks from user.queries.ts
@github-actions

Copy link
Copy Markdown

🧪 Test Summary

Job Status
Bun Unit Tests ✅ success
E2E Regression (0) ⏭️ pending
E2E Regression (1) ⏭️ pending
E2E Regression (2) ⏭️ pending
E2E Regression (3) ⏭️ pending
E2E Smoke ✅ success
Unit Tests ✅ success

View workflow run

📎 Artifacts

Videos and screenshots from failed E2E tests:

user.service.ts was already dead — index.ts re-exported createUserGqlService
as createUserService, so all callers were already hitting the GraphQL path.

- Delete user.service.ts
- Strip REST-only adapter functions and imports from user.adapter.ts
- Rewrite user.adapter.test.ts with fromGatewayUser / fromGatewayUserIdentity coverage
Switch user.queries.ts hooks from createUserService to createUserGqlService,
move userKeys into user.gql-service.ts, and clean up index.ts exports now
that user.service.ts is gone.
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