Sha256: 3737d1cd79fc77f59fea5e021f289ec3e5cc86a21850c9c629a5dd5a74787156

Contents?: true

Size: 684 Bytes

Versions: 52

Compression:

Stored size: 684 Bytes

Contents

# frozen_string_literal: true

module Decidim
  module Comments
    class CommentMutationType < Decidim::Api::Types::BaseObject
      graphql_name "CommentMutation"
      description "A comment which includes its available mutations"

      field :id, GraphQL::Types::ID, "The Comment's unique ID", null: false

      field :up_vote, Decidim::Comments::CommentType, null: true
      def up_vote(args: {})
        VoteCommentResolver.new(weight: 1).call(object, args, context)
      end

      field :down_vote, Decidim::Comments::CommentType, null: true
      def down_vote(args: {})
        VoteCommentResolver.new(weight: -1).call(object, args, context)
      end
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
decidim-comments-0.29.2 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.28.5 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.29.1 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.28.4 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.27.9 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.29.0 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.28.3 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.27.8 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.29.0.rc4 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.29.0.rc3 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.29.0.rc2 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.29.0.rc1 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.28.2 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.27.7 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.28.1 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.27.6 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.26.10 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.26.9 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.28.0 lib/decidim/api/comment_mutation_type.rb
decidim-comments-0.27.5 lib/decidim/api/comment_mutation_type.rb