One problem with passing Prisma requests and responses across the network is that the data is not always serializable. The following Prisma types are problematic:
Dateobject is serializable, but its type is lost
Bytes: not serializable
BigInt: not serializable
Decimal: not serializable
ZenStack solves this problem by using superjson to deserialize input and serialize output. Since data is still JSON-serializable most of the time, ZenStack adopts superjson in a non-intrusive way. The serialized data is directly put inside the request or response data. When there is extra serialization information (superjson generates it when it encounters data that's not JSON-serializable), it's put inside the
meta field in the request or response.
The benefit of this design is that if the data is fully JSON-serializable (not involving the types mentioned above), the wire format is just plain JSON serialization without any pollution.