Sha256: 9c4307e25098b28f5e1b3b5b90ebcf436f3f52173560ed043e10a3cf403a71ee

Contents?: true

Size: 740 Bytes

Versions: 4

Compression:

Stored size: 740 Bytes

Contents

module Mutations
  module Base::ArticleCategory
    class UpdateArticleCategory < BaseMutation
      field :article_category_edge, Types::ArticleCategoryType.edge_type, null: false

      argument :id, String, required: true
      argument :is_deleted, Boolean, required: false
      argument :name, String, required: false
      argument :tags, [String], required: false

      def resolve(**args)
        _, args[:id] = SoulsApiSchema.from_global_id(args[:id])
        article_category = ::ArticleCategory.find(args[:id])
        article_category.update(args)
        { article_category_edge: { node: ::ArticleCategory.find(args[:id]) } }
      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/update_article_category.rb
souls-0.24.1 apps/api/app/graphql/mutations/base/article_category/update_article_category.rb
souls-0.22.8 hoy/app/graphql/mutations/base/article_category/update_article_category.rb
souls-0.22.7 hoy/app/graphql/mutations/base/article_category/update_article_category.rb