Update addDiscussionComment to respect immutable pattern

Summary

Apollo 2.6 introduced immutable cache which is already enabled in !19236 (merged).

!19536 (merged) was intended to implement this for addDiscussionComment, but due to #35898 (closed) - error was not properly caught in development.

This will result in the error as soon as #35898 (closed) will be resolved:

image

See gitlab-org/frontend/rfcs#34 (closed) for more context

Additionally, this leads to unpredictable side-effects in future

Possible solution

Either rewrite addDiscussionComment manually to respect immutable pattern, or consider decision on ttps://gitlab.com/gitlab-org/frontend/rfcs/issues/34 if we could use immer or other library

/cc @tomquirk because of !19536 (merged)

Edited Nov 08, 2019 by Tom Quirk
Assignee Loading
Time tracking Loading