Closed erezmus closed 4 years ago
@Cooryd @will-byrne If you could comment on number 2 that would be great as you have more experience with the client
checked on xpub and we are storing as 'aff':
author | {"{\"meta\": {\"corresponding\": true}, \"alias\": {\"aff\": \"Tech team, University of eLife\", \"email\": \"test@example.com\", \"lastName\": \"Swartz\", \"firstName\": \"Aaron\"}}"}
ok - let's use that then - don't care really what we use in the GraphQL - as long as it get's mapped to aff
in the database :+1:
@diversemix sorry which option?
after discussing with rest of team, option 4 has been chosen
toDatabaseEntry
and toModel
methods in the team repository.
Currently, we have in the GraphQL definition:
and
In typescript, we have:
the GraphQL and TS differ by "institution" field being named as "aff". However we are saving the teamMember for authors with "institution" rather than "aff":
therefore when we have an
AuthorDetails
object in typescript, it actually doesn't have an "aff" field but an "institution" field. This is causing issues for instance when doing the validation for submission as its expecting there to be anaff
field:Solutions:
Rename
aff
toinstitution
in typescript type. However, i think we are using 'aff' in xpub.Change the client to use 'aff' instead of 'institution'. I'm not sure of all the ramifications for this so will need advice.
Convert from 'institution' => 'aff' at resolver level and then change it back to 'institution' when sending the Submission object back. However we would need to have a separate Submission type to send back because the AuthorDetails don't match between Typescript and GraphQL
Same as 3 but at the repository level with the same issue that we would need to use slightly different types for the DatabaseEntry's
team_members
field (AuthorTeamMember specifically)