aws / aws-appsync-community

The AWS AppSync community
https://aws.amazon.com/appsync
Apache License 2.0
506 stars 32 forks source link

DECIMAL datatypes from datasources #64

Open AlexEshoo opened 4 years ago

AlexEshoo commented 4 years ago

I have an Aurora serverless (MySQL) datasource defined which has a few fields that are of type DECIMAL. It's unclear to me how I should handle them on the GraphQL layer since AppSync does not support this type. Float seems improper since it will truncate some of the precision of the number.

Are there any plans to support Decimal scalars that are not finite precision?

T-Caines commented 4 years ago

Looking at the AWS Developer Docs for Using the Data API for Aurora Serverless, DECIMAL type is represented by a STRING when calling the Data API.

I would suggest modeling this as a String in your schema. You can then convert it to a DECIMAL downstream in your application.