feat(graphql): expose referralRewardEnabled on Globals - #464
Merged
Conversation
Surface config.referralReward.enabled (the same flag that already gates
the referral payout in award-referral-reward.ts) as a public Globals
boolean, mirroring topupEnabled/cashoutEnabled/bridgeEnabled. This lets
the mobile client show reward-promising UI — the "invite a friend"
home-screen card ("Get rewards for inviting friends") — only when
referral rewards are actually enabled, so the promise and the payout
share one source of truth and can't drift.
Regenerated the public + supergraph SDL snapshots (check:sdl).
No bespoke resolver test: this mirrors the three sibling passthroughs
(topup/cashout/bridgeEnabled), which are verified by the checked-in SDL
snapshot rather than a unit test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C7z7o9J18BWbUnYJcemMtg
bobodread876
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a public
Globals.referralRewardEnabledboolean, resolved fromgetReferralRewardConfig().enabled— the same config flag that already gates the referral payout (src/app/invite/award-referral-reward.ts). Mirrors the existingtopupEnabled/cashoutEnabled/bridgeEnabledpattern onGlobals.Why
The flash-mobile invite feature (#679) shows a home-screen QuickStart card that promises "Get rewards for inviting friends to Flash." Rewards are default-disabled and dark in prod, so that card is a false promise while off. Surfacing this flag lets the client show the reward-promising UI only when referral rewards are actually enabled — one source of truth, no drift between the promise and the payout. (Chosen over a Firebase Remote Config flag precisely to avoid a second source of truth.)
Behavior
referralReward.enabled=true→ field returns true → mobile card shows.false→ field returns false → mobile card stays hidden until rewards are activated.This must be deployed to an environment before the flash-mobile query that selects it ships to that env. Apollo validates the whole
globalsselection server-side, so an unknown field errors the entireglobalsquery (breaking every flag read); a client?? falsefallback only covers null, not an unknown field. Sequence: merge + deploy this → confirm the field resolves on TEST → then merge the flash-mobile filter (#679 follow-up).Tests
No bespoke resolver test — this is a config passthrough identical to the three sibling flags (topup/cashout/bridge), which are covered by the checked-in public SDL snapshot (
check:sdl) rather than a unit test. The regeneratedschema.graphql+supergraph.graphqlare included.🤖 Generated with Claude Code