MergeRequest#subscribe field should be more expensive in GraphQL

The subscribed field of merge requests need so look at notes linked to the issuable, which could be expensive.

We need to raise the complexity of the subscribed field in Types::MergeRequestType.


GraphQL is exposing MergeRequest#subscribed attribute.

We do not expose that field when fetching for issues/merge requests collections in the regular REST API. This is because it searches through issuable notes looking for mentions of the user which can be an expensive operation. Check: https://gitlab.com/gitlab-org/gitlab/blob/master/lib/api/entities.rb#L659

Could this be also a problem on GraphQL?

If yes, should we do the same we do at the regular API and expose that field only when querying for single merge requests?

Edited Oct 15, 2019 by Bob Van Landuyt
Assignee Loading
Time tracking Loading