Skip to content

Conversation

@tiankii
Copy link

@tiankii tiankii commented Jul 15, 2025

Description

This PR updates the quiz claim logic to support a skipRewards flag. When skipRewards is true, the system bypasses key validations and payment steps, allowing quiz completion without errors or rewards.

Changes:

  • Added skipRewards flag to the quiz claim input.
  • When skipRewards is true, the following errors are omitted and no payment is processed:
    • InvalidPhoneForQuizError (Unsupported phone carrier)
    • InvalidIpMetadataError (Unsupported IP)
    • QuizClaimedTooEarlyError (Daily section limit)
    • NotEnoughBalanceForQuizError (Insufficient wallet funds)
  • When skipRewards is false, all validations and payments occur as usual.
  • Quizzes are marked as completed in both cases.

name: "QuizClaimInput",
fields: () => ({
id: { type: GT.NonNull(GT.ID) },
skipRewards: { type: GT.Boolean },

Choose a reason for hiding this comment

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

default must be here

Choose a reason for hiding this comment

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

skipRewards: { type: GT.Boolean, defaultValue: false },

},
resolve: async (_, args, { domainAccount, ip }) => {
const { id } = args.input
const { id, skipRewards = false } = args.input

Choose a reason for hiding this comment

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

default must be in the input

Choose a reason for hiding this comment

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

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants