diff --git a/app/graphql/util/error_builder.rb b/app/graphql/util/error_builder.rb index 1167cc35..0be64ffc 100644 --- a/app/graphql/util/error_builder.rb +++ b/app/graphql/util/error_builder.rb @@ -2,9 +2,9 @@ module Util class ErrorBuilder def self.build_errors(context, errors) - errors.map do |attr, message| - message = "#{attr}: #{message}" - context.add_error(GraphQL::ExecutionError.new(message, extensions: { code: 'INPUT_ERROR', attribute: attr })) + errors.each do |error| + message = "#{error.attribute}: #{error.message}" + context.add_error(GraphQL::ExecutionError.new(message, extensions: { code: 'INPUT_ERROR', attribute: error.attribute })) end return end