Skip to content

ALFMOB-336 Setup BFF graphql networking#19

Open
hoangnhatdrk wants to merge 9 commits into
mainfrom
feature/ALFMOB-336_setup_bff_graphql_networking
Open

ALFMOB-336 Setup BFF graphql networking#19
hoangnhatdrk wants to merge 9 commits into
mainfrom
feature/ALFMOB-336_setup_bff_graphql_networking

Conversation

@hoangnhatdrk
Copy link
Copy Markdown
Contributor

What

  • Upgrade Apollo Kotlin from 4.0.0-beta.4 to 4.3.1 (package rename apollo3apollo)
  • Fix environment URLs: Dev points to 10.0.2.2:3000 (emulator), PreProd/Prod URLs are TODO
  • Update network_security_config.xml to use 10.0.2.2 instead of hardcoded personal IP
  • Split Apollo codegen into two services: legacy (port 4000) and new (port 3000, empty — ready for migration)
  • Add @LegacyClient / @NewClient Hilt qualifiers with two separate ApolloClient providers
  • All existing services injected with @LegacyClient — no behaviour change
  • Commit schemas (schema-legacy.graphqls, schema-new.graphqls) so builds never require a live server

Why

Sets up the networking infrastructure to support a feature-by-feature migration from the legacy BFF (port 4000) to the new BFF (port 3000). Each feature migrates independently by writing new queries in graphql/new/ and switching its service to @NewClient.

Copilot AI review requested due to automatic review settings May 21, 2026 08:55

This comment was marked as resolved.

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 21, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcom.apollographql.apollo/​apollo-runtime@​4.3.1100100100100100
Addedcom.apollographql.apollo/​apollo-testing-support@​4.3.1100100100100100

View full report

Nhat Hoang added 2 commits May 21, 2026 16:11
@hoangnhatdrk hoangnhatdrk self-assigned this May 21, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 45 changed files in this pull request and generated 4 comments.

Comment on lines +56 to +63
.serverUrl(environmentManager.newUrl())
.okHttpClient(okHttpClient)
.addHttpInterceptor(LoggingInterceptor(level = BODY))
.addInterceptor(networkStatusInterceptor)
.build()

private fun EnvironmentManager.legacyUrl() = runBlocking { current().legacyGraphQLUrl }
private fun EnvironmentManager.newUrl() = runBlocking { current().graphQLUrl }
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a blocker for now since it's existing pattern, but worth taking a look. I guess it's mainly because we allow users to edit the URL in debug menu and save it in storage.
We can take a look at this and optimize it separately. I'll log a ticket for it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 22 to 26
PreProd(
url = "https://api-preprod.localhost:4000/graphql",
// TODO(ALFMOB-336): Replace with real PreProd BFF URL once confirmed by the BFF team.
url = "https://api-preprod.alfie.com/graphql",
legacyUrl = "https://api-legacy-preprod.alfie.com/graphql",
buildType = BuildType.BETA
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, auto-complete. Marked with TBD, I'll log a ticket to correct this separately later on once we are ready. We only care about Dev server in this ticket.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 28 to 32
Prod(
url = "https://api.localhost:4000/graphql",
// TODO(ALFMOB-336): Replace with real Prod BFF URL once confirmed by the BFF team.
url = "https://api.alfie.com/graphql",
legacyUrl = "https://api-legacy.alfie.com/graphql",
buildType = BuildType.RELEASE
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

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