Commit 5c81d3e4 authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'ld-graphql-use-mutation-errors-on-object' into 'master'

Use GraphQL errors_on_object for collecting errors

See merge request gitlab-org/gitlab!32589
parents 4c4a05b5 323f5146
......@@ -9,7 +9,7 @@ module Mutations
field :errors, [GraphQL::STRING_TYPE],
null: false,
description: "Errors encountered during execution of the mutation."
description: 'Errors encountered during execution of the mutation.'
def current_user
context[:current_user]
......
......@@ -19,7 +19,7 @@ module Mutations
{
issue: issue,
errors: issue.errors.full_messages
errors: errors_on_object(issue)
}
end
end
......
......@@ -19,7 +19,7 @@ module Mutations
{
issue: issue,
errors: issue.errors.full_messages
errors: errors_on_object(issue)
}
end
end
......
......@@ -33,7 +33,7 @@ module Mutations
{
issue: issue,
errors: issue.errors.full_messages
errors: errors_on_object(issue)
}
end
end
......
......@@ -40,7 +40,7 @@ module Mutations
{
merge_request: merge_request,
errors: merge_request.errors.full_messages
errors: errors_on_object(merge_request)
}
end
end
......
......@@ -41,7 +41,7 @@ module Mutations
{
merge_request: merge_request,
errors: merge_request.errors.full_messages
errors: errors_on_object(merge_request)
}
end
......
......@@ -21,7 +21,7 @@ module Mutations
{
merge_request: merge_request,
errors: merge_request.errors.full_messages
errors: errors_on_object(merge_request)
}
end
end
......
......@@ -22,7 +22,7 @@ module Mutations
{
merge_request: merge_request,
errors: merge_request.errors.full_messages
errors: errors_on_object(merge_request)
}
end
end
......
......@@ -18,7 +18,7 @@ module Mutations
{
merge_request: merge_request,
errors: merge_request.errors.full_messages
errors: errors_on_object(merge_request)
}
end
end
......
......@@ -21,7 +21,7 @@ module Mutations
{
merge_request: merge_request,
errors: merge_request.errors.full_messages
errors: errors_on_object(merge_request)
}
end
......
......@@ -690,8 +690,9 @@ should look like this:
# The merge request modified, this will be wrapped in the type
# defined on the field
merge_request: merge_request,
# An array if strings if the mutation failed after authorization
errors: merge_request.errors.full_messages
# An array of strings if the mutation failed after authorization.
# The `errors_on_object` helper collects `errors.full_messages`
errors: errors_on_object(merge_request)
}
```
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment