-
-
Save ShopifyEng/94ccfd46a235e0d08824219a9bcb7422 to your computer and use it in GitHub Desktop.
Understanding GraphQL for Beginners–Part Three
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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