The code you wrote translates to this:
const createRecordMapping = (): unknown => mapper.createMap(Record, RecordDto)
.forMember((d) => /*d.value, */mapFrom((s) => GraphQLJSON.parseValue(s.value)));
You probably wanted to chain the functions:
const createRecordMapping = (): unknown => mapper.createMap(Record, RecordDto)
.forMember((d) => d.value)
.mapFrom((s) => GraphQLJSON.parseValue(s.value) as unknown);
Also, the GraphQLJSON.parseValue
probably does return any
type, as it is parsing JSON.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…