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

GraphQL connection's after and before doesn't accept cursor #120

Open
flowersinthesand opened this issue Nov 10, 2020 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@flowersinthesand
Copy link
Contributor

I found this bug in playing around with example-api-gateway.

Poll connection works if after is not given:

{queryPoll(first: 2) {pageInfo{hasNextPage startCursor endCursor} edges {node {id}}}}
{
  "data": {
    "queryPoll": {
      "pageInfo": {
        "hasNextPage": true,
        "startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
        "endCursor": "YXJyYXljb25uZWN0aW9uOjE="
      },
      "edges": [
        {
          "node": {
            "id": 1
          }
        },
        {
          "node": {
            "id": 2
          }
        }
      ]
    }
  }
}

It doesn't work if a correct after which is the value of endCursor is given

{queryPoll(after: "YXJyYXljb25uZWN0aW9uOjE=" first: 2) {pageInfo{hasNextPage startCursor endCursor} edges {node {id}}}}
{
  "data": {
    "queryPoll": null
  },
  "errors": [
    {
      "message": "invalid input syntax for type bigint: \"YXJyYXljb25uZWN0aW9uOjE=\"",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "queryPoll"
      ]
    }
  ]
}

But it does if a wrong after which is the id value of last item of edges' node is given

{queryPoll(after: "2" first: 2) {pageInfo{hasNextPage startCursor endCursor} edges {node {id}}}}
{
  "data": {
    "queryPoll": {
      "pageInfo": {
        "hasNextPage": true,
        "startCursor": "YXJyYXljb25uZWN0aW9uOjA=",
        "endCursor": "YXJyYXljb25uZWN0aW9uOjE="
      },
      "edges": [
        {
          "node": {
            "id": 3
          }
        },
        {
          "node": {
            "id": 4
          }
        }
      ]
    }
  }
}
@manh-vv manh-vv added the bug Something isn't working label Nov 17, 2020
@manh-vv manh-vv assigned boomspeed94 and unassigned manh-vv Nov 17, 2020
boomspeed94 added a commit to boomspeed94/aloxide that referenced this issue Nov 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants