Fix bug in snippet create mutation with non ActiveRecord errors
What does this MR do?
Refs #217727 (closed) and, in particular, #217727 (comment 349470507).
The Snippets::CreateService
service can return also non ActiveRecord errors. Nevertheless, in the GraphQL create mutation, when the service has been called, we check snippet.valid?
to see whether the execution was successful or not. This is totally wrong, because it will flush any non ActiveRecord error.
We should check the ServiceResponse
response code instead.
Does this MR meet the acceptance criteria?
Conformity
Edited by 🤖 GitLab Bot 🤖