Sha256: 20a9f01a72e603b6527398e1850b90568465a67eb111007d9e6dd9b8e92d84cd

Contents?: true

Size: 543 Bytes

Versions: 4

Compression:

Stored size: 543 Bytes

Contents

module Mutations
  module Base::ArticleCategory
    class DestroyDeleteArticleCategory < BaseMutation
      field :article_category, Types::ArticleCategoryType, null: false
      argument :id, String, required: true

      def resolve(**args)
        _, data_id = SoulsApiSchema.from_global_id(args[:id])
        article_category = ::ArticleCategory.find(data_id)
        article_category.destroy
        { article_category: article_category }
      rescue StandardError => e
        GraphQL::ExecutionError.new(e)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
souls-0.24.2 apps/api/app/graphql/mutations/base/article_category/destroy_delete_article_category.rb
souls-0.24.1 apps/api/app/graphql/mutations/base/article_category/destroy_delete_article_category.rb
souls-0.22.8 hoy/app/graphql/mutations/base/article_category/destroy_delete_article_category.rb
souls-0.22.7 hoy/app/graphql/mutations/base/article_category/destroy_delete_article_category.rb