Closed davefrey closed 3 years ago
votingResult
can definitely be returned for (create|delete)_(vote|delegation) in the current api PR #227 I am working on, though I am not sure this was working correctly before (it probably was). The votingResult
query has to be present in the absinthe mutation operation(s), of course.
e.g: (note: votingMethod
is not a valid field for mutations or queries in the current deployed api)
Oh this is excellent, thank you! It's not the api that is the problem but the parsed graphql query in api_client.rb in our module that specifies the return value. Today it's only returning the :id but I can change that to be a votingResult, then I can parse and return the suitable thing from the ApiClient
😀
I'll close the related issue liquidvotingio/api#189 I don't think we need anything in that repo.
All four of the api mutations, (create|delete)_(vote|delegation), can alter the number of votes for a proposal. Currently, only the vote mutators are updating the proposals.proposal_vote_count which is displayed in the interface as "nnn Supports". But delegations affect the count as well when the delegate has already voted: the number of votes for a proposal will increase by the weight of the delegator (their own vote + any delegations naming them as delegate).
In the case of
create_delegation
, theApiClient
(and apparently the api itself, see liquidvotingio/api#189) returntrue
instead of a response containing avoting_result
.In the case of
delete_delegation
, there is a response containing avoting_result
returned to the client, but our module code does not extract the new vote count and save it in the proposal.