<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def coerce_to_decimal(value):
 """Attempt to coerce the value to a Decimal, or raise an error if unable to do so."""

    if isinstance(value, decimal.Decimal):
        return value
    else:
        try:
            return decimal.Decimal(value)
        except decimal.InvalidOperation as e:
            raise GraphQLInvalidArgumentError(e)