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 ...@@ -9,7 +9,7 @@ module Mutations
field :errors, [GraphQL::STRING_TYPE], field :errors, [GraphQL::STRING_TYPE],
null: false, null: false,
description: "Errors encountered during execution of the mutation." description: 'Errors encountered during execution of the mutation.'
def current_user def current_user
context[:current_user] context[:current_user]
......
...@@ -19,7 +19,7 @@ module Mutations ...@@ -19,7 +19,7 @@ module Mutations
{ {
issue: issue, issue: issue,
errors: issue.errors.full_messages errors: errors_on_object(issue)
} }
end end
end end
......
...@@ -19,7 +19,7 @@ module Mutations ...@@ -19,7 +19,7 @@ module Mutations
{ {
issue: issue, issue: issue,
errors: issue.errors.full_messages errors: errors_on_object(issue)
} }
end end
end end
......
...@@ -33,7 +33,7 @@ module Mutations ...@@ -33,7 +33,7 @@ module Mutations
{ {
issue: issue, issue: issue,
errors: issue.errors.full_messages errors: errors_on_object(issue)
} }
end end
end end
......
...@@ -40,7 +40,7 @@ module Mutations ...@@ -40,7 +40,7 @@ module Mutations
{ {
merge_request: merge_request, merge_request: merge_request,
errors: merge_request.errors.full_messages errors: errors_on_object(merge_request)
} }
end end
end end
......
...@@ -41,7 +41,7 @@ module Mutations ...@@ -41,7 +41,7 @@ module Mutations
{ {
merge_request: merge_request, merge_request: merge_request,
errors: merge_request.errors.full_messages errors: errors_on_object(merge_request)
} }
end end
......
...@@ -21,7 +21,7 @@ module Mutations ...@@ -21,7 +21,7 @@ module Mutations
{ {
merge_request: merge_request, merge_request: merge_request,
errors: merge_request.errors.full_messages errors: errors_on_object(merge_request)
} }
end end
end end
......
...@@ -22,7 +22,7 @@ module Mutations ...@@ -22,7 +22,7 @@ module Mutations
{ {
merge_request: merge_request, merge_request: merge_request,
errors: merge_request.errors.full_messages errors: errors_on_object(merge_request)
} }
end end
end end
......
...@@ -18,7 +18,7 @@ module Mutations ...@@ -18,7 +18,7 @@ module Mutations
{ {
merge_request: merge_request, merge_request: merge_request,
errors: merge_request.errors.full_messages errors: errors_on_object(merge_request)
} }
end end
end end
......
...@@ -21,7 +21,7 @@ module Mutations ...@@ -21,7 +21,7 @@ module Mutations
{ {
merge_request: merge_request, merge_request: merge_request,
errors: merge_request.errors.full_messages errors: errors_on_object(merge_request)
} }
end end
......
...@@ -690,8 +690,9 @@ should look like this: ...@@ -690,8 +690,9 @@ should look like this:
# The merge request modified, this will be wrapped in the type # The merge request modified, this will be wrapped in the type
# defined on the field # defined on the field
merge_request: merge_request, merge_request: merge_request,
# An array if strings if the mutation failed after authorization # An array of strings if the mutation failed after authorization.
errors: merge_request.errors.full_messages # 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