Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Understanding GraphQL for Beginners–Part Three
module Mutations
class NutritionDelete < BaseMutation
argument :id, ID, required: true
type Types::NutritionType
def resolve(id:)
nutrition = Nutrition.find(id)
nutrition.destroy!
return nutrition
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment