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

[v2.0] Relay after argument not working for custom functions #6878

Open
PedroBern opened this issue May 6, 2021 · 0 comments
Open

[v2.0] Relay after argument not working for custom functions #6878

PedroBern opened this issue May 6, 2021 · 0 comments

Comments

@PedroBern
Copy link
Contributor

PedroBern commented May 6, 2021

Related #5658

Relay after argument not working in v2.0.

Repro

Take a custom function and run:

query MyQuery {
  my_custom_function_connection(args: {seed: "0.5"}, first: 2) {
    edges {
      node {
        id
        pk
      }
      cursor
    }
  }
}

The response will be something like this:

{
  "data": {
    "my_custom_function_connection": {
      "edges": [
        {
          "node": {
            "id": "WzEsICJwdWJsaWMiLCAid29kIiwgNDJd",
            "pk": 42
          },
          "cursor": "eyJwayIgOiA0Mn0="
        },
        {
          "node": {
            "id": "WzEsICJwdWJsaWMiLCAid29kIiwgMzFd",
            "pk": 31
          },
          "cursor": "eyJwayIgOiAzMX0="
        }
      ]
    }
  }
}

Now, do one more query, with the after argument being the cursor of the first node:

query MyQuery {
  my_custom_function_connection(args: {seed: "0.5"}, first: 2, after: "eyJwayIgOiA0Mn0=") {
    edges {
      node {
        id
        pk
      }
      cursor
    }
  }
}

received:

{
  "data": {
    "my_custom_function_connection": {
      "edges": [
        {
          "node": {
            "id": "WzEsICJwdWJsaWMiLCAid29kIiwgNTNd", expected "WzEsICJwdWJsaWMiLCAid29kIiwgMzFd"
            "pk": 53 expected 31
          },
          "cursor": "eyJwayIgOiA1M30="
        },
        {
          "node": {
            "id": "WzEsICJwdWJsaWMiLCAid29kIiwgNDVd",
            "pk": 45
          },
          "cursor": "eyJwayIgOiA0NX0="
        }
      ]
    }
  }
}

Expected the first node in the second query to be the same as the second node in the first query. But it wasn't.

@PedroBern PedroBern reopened this May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant