Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix decimal value

fowczarekdae5b81655dc
diff --git a/saleor/graphql/core/types/common.py b/saleor/graphql/core/types/common.py
index 2b74c06bd7..d83ff5d009 100644
--- a/saleor/graphql/core/types/common.py
+++ b/saleor/graphql/core/types/common.py
@@ -23,6 +23,13 @@ class Decimal(graphene.Float):
parses float to the Decimal on the way back.
"""
+ @staticmethod
+ def parse_literal(node):
+ try:
+ return decimal.Decimal(node.value)
+ except decimal.DecimalException:
+ return None
+
@staticmethod
def parse_value(value):
try: