Skip to content

PART3: feat(settings): Migrate fxa-settings from GraphQL to direct auth-client (cutover)#19981

Open
vbudhram wants to merge 1 commit intomainfrom
FXA-12995
Open

PART3: feat(settings): Migrate fxa-settings from GraphQL to direct auth-client (cutover)#19981
vbudhram wants to merge 1 commit intomainfrom
FXA-12995

Conversation

@vbudhram
Copy link
Contributor

@vbudhram vbudhram commented Feb 2, 2026

Because

  • The fxa-graphql-api service adds unnecessary latency and complexity between fxa-settings and fxa-auth-server
  • GraphQL mutations/queries coupled the frontend to Apollo cache management, making state management harder to reason about
  • Direct auth-client calls simplify the data flow and reduce the dependency surface

This pull request

  • Removes ApolloProvider, ApolloClient, and all GQL mutations/queries from the fxa-settings entrypoint and page containers
  • Replaces GQL calls with direct fxa-auth-client methods (signInWithAuthPW, getCredentialStatusV2,
    sendUnblockCode, etc.)
  • Adds account-storage.ts — unified localStorage-based account state replacing the Apollo InMemoryCache
  • Adds AccountStateContext and
    AuthStateContext React contexts for reactive state management
  • Adds useAccountData hook that fetches account, profile, and attached clients data in parallel via auth-client
  • Renames gql-key-stretch-upgrade to auth-key-stretch-upgrade, now calling auth-client directly
  • Replaces Apollo cache with a no-op shim for remaining legacy references (gql.ts)
  • Removes @apollo/client and graphql from fxa-settings dependencies
  • Removes PageMfaGuardWithGqlTest (GQL-only test page)
  • Updates all Signin, Signup, InlineTotpSetup, and InlineRecoverySetup containers and their tests

Issue

Closes: https://mozilla-hub.atlassian.net/browse/FXA-12995

Checklist

  • My commit is GPG signed
  • Tests pass locally (if applicable)
  • Documentation updated (if applicable)
  • RTL rendering verified (if UI changed)

Other Information

Scope: 90 files changed, ~2,600 insertions, ~2,700 deletions

Breaking changes: The fxa-graphql-api server is no longer required for fxa-settings to function. CSP rules for the GQL endpoint have been removed from content-server configuration.

Legacy shim: gql.ts and cache.ts retain a no-op Apollo cache shim for files not yet migrated (PostVerify, SetPassword, InlineRecoveryKeySetup). These should be cleaned up in a follow-up.

@vbudhram vbudhram self-assigned this Feb 2, 2026
@vbudhram vbudhram force-pushed the FXA-12995 branch 2 times, most recently from d8b0f36 to 5886060 Compare February 6, 2026 04:40
@vbudhram vbudhram marked this pull request as ready for review February 6, 2026 15:16
@vbudhram vbudhram requested a review from a team as a code owner February 6, 2026 15:16
@vbudhram vbudhram changed the title PART3: feat(settings): Migrate fxa-settings from GraphQL to direct auth-client (cutover) PART3: feat(settings): Migrate fxa-settings from GraphQL to direct auth-client (cutover) (WIP) Feb 6, 2026
@vbudhram vbudhram force-pushed the FXA-12995 branch 4 times, most recently from 0f6db37 to 2c6b6b1 Compare February 6, 2026 18:53
@vbudhram vbudhram changed the title PART3: feat(settings): Migrate fxa-settings from GraphQL to direct auth-client (cutover) (WIP) PART3: feat(settings): Migrate fxa-settings from GraphQL to direct auth-client (cutover) Feb 6, 2026
@vbudhram vbudhram requested a review from dschom February 6, 2026 19:43
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