Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong field name #3068

Open
3 tasks done
giafrata opened this issue Mar 13, 2024 · 0 comments
Open
3 tasks done

Wrong field name #3068

giafrata opened this issue Mar 13, 2024 · 0 comments
Labels
Needs: Reproduction This issue needs to be reproduced independently. Type: Bug Something isn't working

Comments

@giafrata
Copy link

giafrata commented Mar 13, 2024

Description

Doing a query to retrieve paginated comments in a single post, passing after parameter raise this error

"debugMessage": "Expected "value" value to be provided for WPGraphQL\Data\Cursor\CommentObjectCursor cursor compare field. A scalar value must be given.",

the problem is that you are checking for "by" variable but are using "value" here

if ( ! isset( $field['value'] ) ) {

query AllComments($postId: ID!, $after: String = "") {
  post(id: $postId, idType: DATABASE_ID) {
    id
    comments(where: {orderby: COMMENT_PARENT, order: ASC}, last: 1, after: $after) {
      pageInfo {
        endCursor
        hasNextPage
        hasPreviousPage
        startCursor
      }
      nodes {
        content(format: RENDERED)
        author {
          node {
            name
            email
          }
        }
        id
        databaseId
        date
        parentId
        dateGmt
        replies {
          nodes {
            content(format: RENDERED)
            author {
              node {
                name
                email
              }
            }
            id
            databaseId
            parentId
            date
            dateGmt
          }
        }
      }
    }
    commentCount
  }
}

Steps to reproduce

Try to paginate comments using after parameter.

Additional context

No response

WPGraphQL Version

1.22.0

WordPress Version

6.4.1

PHP Version

8.1

Additional environment details

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have disabled ALL plugins except for WPGraphQL.

  • Yes
  • My issue is with compatibility with a specific WordPress plugin, and I have listed all my installed plugins (and version info) above.
@josephfusco josephfusco added Type: Bug Something isn't working Needs: Reproduction This issue needs to be reproduced independently. labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Reproduction This issue needs to be reproduced independently. Type: Bug Something isn't working
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants