Implement the scalar as a class decorated with @Scalar('ScalarName', () => NativeType) and add it to the module's providers array. The class must define parseValue (client to server), serialize (server to client), and parseLiteral (inline literal in the query). The scalar name in @Scalar() must match the @Field() type annotation.
serialize() — converts the server-side value to the wire format sent to the client.
parseValue() — converts a client-provided variable value to the server-side type.
parseLiteral() — converts an inline literal in the query document to the server-side type.
The scalar name in @Scalar() must match the name used in @Field(() => ScalarType).
Add the scalar class to the module providers — it is not auto-discovered.