0👍
✅
This question really needs more details, including the sections where the editRow
function is defined and where your GraphQL query is called, and the text of the error when id
is not marked as optional. However, I don’t yet have enough reputation to comment so will address this in an answer instead.
With the information given, here is what I can guess:
- The last error messages that you give (
Argument of type 'number | undefined' is not assignable to parameter of type 'number'. Type 'undefined' is not assignable to type 'number'.
) are likely becauseeditRow
expects an argument of typenumber
. By markingid
as optional, you indicate that it may sometimes beundefined
. Either don’t mark it as optional, or makeeditRow
acceptnumber | undefined
and handle theundefined
case in code. - In the case where you remove the "?" from id, what I would check first is that your GraphQL query does in fact request the
id
field. The point of GraphQL is to only request what you need so it is possible that your coworker has not added this field to the request. If it’s not that, I wouldn’t be able to help without the extra details mentioned above.
Source:stackexchange.com