Bytes32 convertImpl(final Object input) {
          if (input instanceof Bytes32 bytes32) {
            return bytes32;
          } else if (input instanceof Bytes bytes) {
            if (bytes.size() <= 32) {
              return Bytes32.leftPad((Bytes) input);
            } else {
              return null;
            }
          } else if (input instanceof StringValue stringValue) {
            return convertImpl(stringValue.getValue());
          } else if (input instanceof String string) {
            if (!Quantity.isValid(string)) {
              throw new CoercingParseLiteralException(
                  "Bytes32 value '" + input + "' is not prefixed with 0x");
            } else {
              try {
                return Bytes32.fromHexStringLenient((String) input);
              } catch (IllegalArgumentException iae) {
                return null;
              }
            }
          } else if (input instanceof VersionedHash versionedHash) {
            return versionedHash.toBytes();
          } else {
            return null;
          }
        }
The Scalars class provides methods for creating GraphQLScalarType objects. These objects
represent the scalar types used in GraphQL, such as Address, BigInt, Bytes, Bytes32, and Long.
Each method in this class returns a GraphQLScalarType object that has been configured with a
specific Coercing implementation. The Coercing implementation defines how that type is
serialized, deserialized and validated.
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/Scalars.java