Project

General

Profile

Download (376 Bytes) Statistics
| Branch: | Tag: | Revision:
module Mutations
class CreateMutation < BaseMutation
field :errors, [Types::AttributeError], null: false

def resolve(params)
object = initialize_object(params)

validate_object(object)
authorize!(object, :create)

save_object(object)
end

private

def initialize_object(params)
resource_class.new(params)
end
end
end
(2-2/4)