Closed satyaaiosdev closed 9 months ago
Can you provide a code sample of what you are doing when this conversion occurs? That is definitely very odd behavior...
let decimal: Decimal = 0.84 let unwrapDecimal = GraphQLNullable.some(0.84) this is getting 0.83999999999999997 and this value send to backend
@AnthonyMDev waiting for your response, FloatingType values are wrongly presiced.
Hi there. Sorry for the slow response, we've been off for the holidays. Now that we are back, we've got a lot of catch up to do this week. But we'll get someone to look into this further as soon as we can. If you end up finding anything else out in the mean time, please update us here!
Hi @AnthonyMDev , not only GraphQLNullable
@satyaaiosdev Can you provide a sample project that demonstrates this issue? In my testing using Decimal
and passing it into GraphQLNullable
as described doesn't demonstrate the issue so I assume the issue is coming from somewhere this variable is being used or acted upon in some way in your code. A sample project that demonstrates the issue would be helpful for us to determine the cause of the issue.
MocupInput(__data: ApolloAPI.InputDict(data: [ "currentBalance": GraphQL.Decimal(decimal:0.83)]))
Than while sending this input request query creating like this requestBody ----- { "operationName" : "MocupAggtegate", "query" : "query MocupAggtegate($input: MocupAggregateInput!) {\n mocupAggregate(input: $input) {\n __typename\n totalValue\n }\n}", "variables" : { "input" : { "totalValue" : 8.0299999999999994, } }
@satyaaiosdev sorry for the delayed response ive been out of office dealing with a death in the family.
so you are using GraphQL.Decimal
which I assume is a custom scalar you have implemented? Can you share your implementation of that?
Closing this under the assumption it is no longer an issue. Feel free to reopen with additional info if needed.
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.
Question
The conversion of Decimal to GraphQLNullable resulted in odd behavior, such as the addition of extra numbers to the value as shown below.
Take GraphQLNullable, for instance.A portion (0.84) receives 0.83999999999999997
However, after conversion, 0.84 was our need.How can one resolve this kind of problem?