code: def coerce_to_decimal(value):
      
      if isinstance(value, decimal.Decimal):
          return value
      else:
          try:
              return decimal.Decimal(value)
          except decimal.InvalidOperation as e:
              raise GraphQLInvalidArgumentError(e)
docs: Attempt to coerce the value to a Decimal, or raise an error if unable to do so.