Skip to content

Fix errors in GraphQL Todos API due to missing TargetTypeEnum values

Luke Duncalfe requested to merge 34757-bugfix-graphql-missing-todo-types into master

What does this MR do?

Fixes missing target types in TargetTypeEnum and separates the EE-specific types.

Adds calls_gitaly for the TodoType#body field, as an error is raised when requesting the todo.body field for a Commit Todo:

RuntimeError (Gitaly is called for field 'body' on Types::TodoType
- please either specify a constant complexity or add
`calls_gitaly: true` to the field declaration)

When the Todo (a polymorphic model) has a target_type of Commit, requesting the body field calls Gitaly (Todo#body calls Todo#target which fetches the Commit from Gitaly) and we get the above error.

I've set calls_gitaly: true for the TodoType#body field (affecting all Todos, regardless of the target_type) in order to avoid the error, while we work out a better solution.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Edited by 🤖 GitLab Bot 🤖

Merge request reports