-
Notifications
You must be signed in to change notification settings - Fork 61
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
Support decoding Decimal as String #490
Support decoding Decimal as String #490
Conversation
@jessey2024: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
👷 Deploy request for eclectic-pie-88a2ba pending review.Visit the deploys page to approve it
|
👷 Deploy request for apollo-ios-docc pending review.Visit the deploys page to approve it
|
Hi @jessey2024, can you give me some more context on how this is needed or where it's useful - thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jessey2024, thanks so much for the PR! This doesn't seem to be likely to cause any issues, but I'm unclear of when you would need this? This function is used for converting a JSON value into a String. Using JSONSerialization
, wouldn't any decimal number be serialized as a Double
? In what situation is this code actually being called?
Ha, I didn't see @calvincestari's response before replying here. :) |
Hi @calvincestari and @AnthonyMDev, |
OK, that makes more sense. I suggest reading our documentation about Custom Scalars as that would be the correct way to deal with types outside of the standard GraphQL scalars. |
@jessey2024 - I'm going to close this PR as I believe Custom Scalars is the correct way to do what you need with those types. If you try that and still have errors then comment in this issue again and we can take another look. |
Allows converting
Decimal
toString
when decoding.Currently, an error is being thrown.