Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Convert received Money.amount from string to number #1863

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sle-c
Copy link
Contributor

@sle-c sle-c commented Dec 11, 2024

WHY are these changes introduced?

Money.amount type from GraphQL actually returns a string as a result of Decimal serialization in the Admin GraphQL schema.

See

https://shopify.dev/docs/api/functions/reference/cart-transform/graphql/common-objects/moneyv2
https://shopify.dev/docs/api/functions/reference/cart-transform/graphql/scalar#decimal-2024-10

  • We want to keep the Money interface consistent in the app.

WHAT is this pull request doing?

  • Catch responses from the Billing GraphQL API and convert all Money.amount type from string to number

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
  • Minor: New feature (non-breaking change which adds functionality)
  • Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have used pnpm changeset to create a draft changelog entry (do NOT update the CHANGELOG.md files manually)
  • I have added/updated tests for this change
  • I have documented new APIs/updated the documentation for modified APIs (for public APIs)

@sle-c sle-c marked this pull request as ready for review December 11, 2024 21:27
@sle-c sle-c requested a review from a team as a code owner December 11, 2024 21:27
@sle-c sle-c changed the title Convert received Money.amount from string to number [Fix] Convert received Money.amount from string to number Dec 11, 2024
Copy link
Contributor

@lizkenyon lizkenyon left a comment

Choose a reason for hiding this comment

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

TY!

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