We have been using Long type variables for output in our schema, but after adding an input variable of type Long, I would get an error message like:
Variable '$timestamp' expected value of type 'Long' but got: 1680746052401. Reason: Long value expected
After copying the LongType implicit conversion code to create a custom implicit val TimestampType: ScalarType[Long] and adding some debug output to test the user input datatype, I found:
Invalid Timestamp coerceUserInput, expected type Long, but got type class java.math.BigDecimal
The existing code has:
case d: BigDecimal if d.isValidLong => Right(d.longValue)
but actually seems to need something like:
case d: java.math.BigDecimal if BigDecimal(d).isValidLong => Right(d.longValue)