Assigning an editor sometimes fails
@markm has reported getting this error occasionally when admin is assigning editor to manuscript:
When this happens, UI appears to show that the editor has been assigned, but the assignment is lost when the admin navigates away from the control page.
Investigation
The graphql error suggests that the failing query is updateTeam
. I notice that the query signature differs from the client to the server:
updateTeam(id: ID!, input: TeamInput)
on the client, updateTeam(id: ID, input: TeamInput): Team
on the server. I'm guessing this isn't the cause of the failure, but preventing nulls on id
and input
might help give us better diagnostics. The signature should really be:
updateTeam(id: ID!, input: TeamInput!): Team!
... and it should throw an exception if the target team doesn't exist.
I'm guessing the failure stems from here if for some reason a team for that role hasn't yet been created for the manuscript, or the client hasn't obtained that team for some reason.