Slide 85
Slide 85 text
Mutations::BaseMutation
module Mutations
class ProductUpdate < BaseMutation
argument_record :product, Product, authorize: :manage
argument :name, String, required: true
argument :tagline, String, required: true
argument :topic_ids, String, required: true
returns Types::ProductType
def perform(product:, **attributes)
Products::Form.submit(
current_user: current_user,
product: product,
attributes: attributes
)
end
end
end