Creates a new FieldMapper instance.
Maps a field name for GraphQL transport. Fields starting with __mj_ are
transformed to _mj__ because GraphQL reserves the __ prefix.
The field name to map.
The mapped field name, or the original field name if no mapping is needed.
Maps fields from one name to another mutating the object in place.
Any field starting with __mj_ is renamed to _mj__ for GraphQL transport.
Optionalobj: Record<string, unknown>The object to mutate
Reverse-maps a GraphQL field name back to the database column name.
Fields starting with _mj__ are transformed back to __mj_.
The field name to reverse-map.
The original database field name.
Maps fields from one name to another mutating the object in place using the reverse mapping.
Any field starting with _mj__ is renamed back to __mj_.
The object to mutate
FieldMapper is used to map fields from one name to another. This is useful when we need to map fields from one system to another, or when we need to map fields from one version of a system to another. Uses an internal field mapping but may be overridden or extended as needed.