Sha256: cdb86253415ad74c562c4932212de7f184311f38b0055260ff4d7dbaf9190570
Contents?: true
Size: 546 Bytes
Versions: 15
Compression:
Stored size: 546 Bytes
Contents
# frozen_string_literal: true module Decidim module Comments # A GraphQL resolver to handle `upVote` and `downVote` mutations # It creates a vote for a comment by the current user. class VoteCommentResolver def initialize(options = { weight: 1 }) @weight = options[:weight] end def call(obj, _args, ctx) Decidim::Comments::VoteComment.call(obj, ctx[:current_user], weight: @weight) do on(:ok) do |comment| return comment end end end end end end
Version data entries
15 entries across 15 versions & 2 rubygems