Skip to content

feat(graphql): expose referralRewardEnabled on Globals - #464

Merged
islandbitcoin merged 1 commit into
mainfrom
feat/referral-reward-globals-flag
Aug 3, 2026
Merged

feat(graphql): expose referralRewardEnabled on Globals#464
islandbitcoin merged 1 commit into
mainfrom
feat/referral-reward-globals-flag

Conversation

@islandbitcoin

Copy link
Copy Markdown
Contributor

What

Adds a public Globals.referralRewardEnabled boolean, resolved from getReferralRewardConfig().enabled — the same config flag that already gates the referral payout (src/app/invite/award-referral-reward.ts). Mirrors the existing topupEnabled/cashoutEnabled/bridgeEnabled pattern on Globals.

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

  • TEST has referralReward.enabled=true → field returns true → mobile card shows.
  • Prod has it false → field returns false → mobile card stays hidden until rewards are activated.

⚠️ Deploy ordering (important)

This must be deployed to an environment before the flash-mobile query that selects it ships to that env. Apollo validates the whole globals selection server-side, so an unknown field errors the entire globals query (breaking every flag read); a client ?? false fallback 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 regenerated schema.graphql + supergraph.graphql are included.

🤖 Generated with Claude Code

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
@islandbitcoin
islandbitcoin merged commit 700b28d into main Aug 3, 2026
15 checks 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