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

Get certified as a Fabric Data Engineer: Check your eligibility for a 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700. Get started

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

JanFabricDE_carousel

Fabric Monthly Update - January 2025

Explore the power of Python Notebooks in Fabric!

JanFabricDW_carousel

Fabric Monthly Update - January 2025

Unlock the latest Fabric Data Warehouse upgrades!