Skip to content

feat(incentives): sync schema with V3 backend, add kind discriminator#159

Merged
mgrabina merged 1 commit into
mainfrom
SDK-779-rewards-hooks
Jun 1, 2026
Merged

feat(incentives): sync schema with V3 backend, add kind discriminator#159
mgrabina merged 1 commit into
mainfrom
SDK-779-rewards-hooks

Conversation

@mgrabina

@mgrabina mgrabina commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Regenerates packages/graphql/schema.graphql against the V3 backend (localhost:3011) and reruns gql-tada generate output so graphql-env.d.ts matches.

Backend PR aave/aave-v3-backend#210 splits POINTS programs by Merkl campaign_id presence but in an additive way: same __typename (SupplyPointsIncentive / BorrowPointsIncentive), discriminated by a new kind: PointsProgramKind! field (CAMPAIGN | LOYALTY). For kind = LOYALTY, dailyPoints / pointsPerThousandUsd are always null.

Schema delta

  • New: enum PointsProgramKind { CAMPAIGN LOYALTY }
  • New field: kind: PointsProgramKind! on SupplyPointsIncentive and BorrowPointsIncentive
  • Plus the accumulated delta since the last sync: extended Merit fields (actionKey, rewardTokenAddress, rewardTokenSymbol, customMessage, customForumLink, selfApr), Merkl + Points incentive types, canonical userRewards query, MeritSavingsGhoIncentive, RewardId scalar.

No removals — verified by diffing the schema SDL produced by backend main vs backend PR #210. Change is purely additive at the GraphQL schema level.

What this PR contains

  • packages/graphql/schema.graphql + graphql-env.d.ts: regenerated against local backend on PR #210
  • packages/graphql/src/fragments/reserve.ts: new fragments for Merkl/Points incentives, kind selected in points fragments, extended Merit fragments
  • packages/graphql/src/fragments/incentives.ts: new file, MeritSavingsGhoIncentiveFragment
  • packages/graphql/src/fragments/index.ts: export the new fragment
  • packages/graphql/src/incentives.ts: userRewards + savingsGhoIncentive queries
  • packages/graphql/src/graphql.ts: RewardId scalar mapping
  • packages/client/src/actions/incentives.ts: client actions
  • packages/react/src/incentives.ts: react hook
  • packages/types/src/id.ts: RewardId branded type
  • .changeset/incentives-kind-sync.md

Test plan

  • pnpm install && pnpm -r build
  • pnpm lint
  • Re-run pnpm gql:download:local against a fresh backend on PR #210 → no further delta
  • Consumers branching on __typename keep working unchanged (no new union variants)
  • Consumers can opt into kind selection to differentiate loyalty vs campaign points

Linear: https://linear.app/aavelabs/issue/SDK-779

Closes SDK-779

@linear

linear Bot commented Apr 24, 2026

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f12848333f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/graphql/src/graphql-env.d.ts
@mgrabina mgrabina changed the title chore(graphql): refresh schema + regenerate gql-tada output chore(incentives): sync GraphQL schema with V3 backend Apr 24, 2026
Sync packages/graphql/schema.graphql + graphql-env.d.ts against the V3
backend (PR #210). The backend now exposes a `kind: PointsProgramKind!`
field on SupplyPointsIncentive / BorrowPointsIncentive (CAMPAIGN for
Merkl-backed programs with live dailyPoints; LOYALTY for fixed-multiplier
partner programs). Consumers gate UI on kind instead of probing nullable
dailyPoints.

Also brings in the rest of the schema delta that's accumulated since the
last sync: extended Merit incentive fields, new MerklSupply / MerklBorrow
/ SupplyPoints / BorrowPoints fragments, canonical userRewards query
(supersedes userMeritRewards), RewardId scalar mapping.
@mgrabina mgrabina force-pushed the SDK-779-rewards-hooks branch from c176260 to 7498642 Compare May 28, 2026 16:34
@mgrabina mgrabina changed the title chore(incentives): sync GraphQL schema with V3 backend feat(incentives): sync schema with V3 backend, add kind discriminator May 28, 2026
@mgrabina mgrabina merged commit b9220ee into main Jun 1, 2026
9 of 10 checks passed
@mgrabina mgrabina deleted the SDK-779-rewards-hooks branch June 1, 2026 17:34
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