Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Sudip
Frequent Visitor

graphql error message. "message": "Decimal cannot parse the given value of type `System.Single`."

I have created a table in warehouse which have data types String,Int,datetime,Real,decimal.

 

I am now trying to do a mutation create and insert some records but I have the mentioned error .

{
  "errors": [
    {
      "message": "Decimal cannot parse the given value of type `System.Single`."
    }
  ]
 
reference of my input and query variable.
mutation CreateCustomer(
  $id: Int!
$rate: Single!
  $amount: Decimal!
$date: DateTime
}
createcustomer(item:{
id:$id,
rate:$rate,
amount:$amount,
date:$date
 
Query Variable is as following:
{
"id":1,
"rate":0.5,
"amount":1005.44,
"date":"2024-08-14T12:00:00.000Z"
}
}
 
I am quite confident that the error is generated by "amount" column. When i try the amount column with value 0. it works without the error
3 REPLIES 3
v-jingzhan-msft
Community Support
Community Support

Hi @Sudip 

 

This error message usually occurs when a System.Single value is being passed to a field that expects a System.Decimal value. This type mismatch can cause parsing errors. Please check the data types of the relevant fields defined in your warehouse. Make sure that the database schema matches the expected data types. 

 

You may refer to Data types in Warehouse section in Data types - Microsoft Fabric | Microsoft Learn

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

could you provide a example?? like what values need to pass for single or decimal datatype. as i see every positive system.single is like decimal data type. 

Hi @Sudip 

 

I haven't tested a mutation in GraphQL. I tested with SQL queries to insert some data into a warehouse table. The result is below. 

If I don't define a precision number and scale number for DECIMAL type column when creating a table, the default scale is 0. When inserting decimal numbers to the table, it will round the numbers. If I define precision number and scale number, it will round numbers to the defined precision and scale. decimal and numeric (Transact-SQL) - SQL Server | Microsoft Learn

vjingzhanmsft_0-1724727892804.pngvjingzhanmsft_0-1724735661398.png

May I know which data type is defined for "amount" column in your warehouse table? 

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.