verbb / comments

A Craft CMS plugin for managing comments directly within the CMS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GraphQL - upvoting a comment is stored as downvoting

bzin opened this issue · comments

Describe the bug

Working with Craft in headless mode and, when trying to use upvote as described in documentation, the comment receives an downvote instead.

Also other errors shown regarding the requested data:
CleanShot 2023-02-22 at 14 58 13

PS: the downvote does indeed set a downvote.

Steps to reproduce

  1. Having comments, vote and flagging to not allow guest posts
  2. Login/Impersonate a user login (we use Craft cookie session and CSRF when communicate with graphql endpoint)
  3. Execute mutation query voteComment as described in docs

Craft CMS version

4.3.6.1

Plugin version

2.0.6

Multi-site?

No

Additional context

We are using this in a headless craft installation. We use Craft cookies to keep a login session in the frontend. The frontend is with React / Next.js.

So to be fair, someone did PR the GQL mutations functionality and wrote the docs (Matt Stein from P&T), so I probably didn't check it as thoroughly as I should've. So firstly, the docs are incorrect - refer to the updated page.

There was also an issue with the return type for these mutations. Fixed for the next release. To get this early run composer require verbb/comments:"dev-craft-4 as 2.0.6"

Great, I will have a look at it @engram-design and will let you know here.

Hi @engram-design , the version you mentioned and the documentation you shared is working nicely.

Thanks for the great work!