Method: GraphQL::Client::Errors#each

Defined in:
lib/graphql/client/errors.rb

#eachObject

Public: Iterates through each error key, value pair in the error messages hash. Yields the field and the error for that attribute. If the field has more than one error message, yields once for each error message.



130
131
132
133
134
135
# File 'lib/graphql/client/errors.rb', line 130

def each
  return enum_for(:each) unless block_given?
  messages.keys.each do |field|
    messages[field].each { |error| yield field, error }
  end
end