Azure / data-api-builder

Data API builder provides modern REST and GraphQL endpoints to your Azure Databases and on-prem stores.
https://aka.ms/dab/docs
MIT License
889 stars 180 forks source link

[Bug]: Float fields get saved based on local Windows Regional format setting #2284

Open evacotelin opened 3 months ago

evacotelin commented 3 months ago

What happened?

I have the following GraphQL schema definition:

type AppReport @model {
  id: ID
  description: String
  latitude: Float
  longitude: Float
  created: DateTime
}

When executing the following mutation, the Float fields (i.e. latitude & longitude) get saved as integers (the decimal separator is removed, not really converted to integer). image

This is due to my Windows Regional format setting, because the comma (,) is used as the default decimal separator: image

When changing my Windows Regional format setting to English (United States) the GraphQL mutation works as expected: saves latitude & longitude fields as Floats (because the point (.) is used as the default decimal separator).

Expected Behaviour: DAB should not be affected by local Windows Regional format settings.

Version

1.1.7+74ea6c5f37f8629fd7f8b13fc56027bf0bf0a93a

What database are you using?

CosmosDB NoSQL

What hosting model are you using?

Static Web Apps (SWA)

Which API approach are you accessing DAB through?

GraphQL

Relevant log output

No response

Code of Conduct