0
salesforce graphql api query accounts, for the second page, using previous endCursor for "after" value, return some duplicate records that already show in the first page. I am using v57 api
First page query:
query accounts {
uiapi {
query {
Account (first:10) {
edges {
node {
Id
Name {
value
}
}
}
}
}
}
}
Second page query with cursor:
query accounts {
uiapi {
query {
Account (first:10, after:"djE6OQ==") {
edges {
node {
Id
Name {
value
}
}
}
}
}
}
}
It should work like Offset/Limit in SOQL, but more efficient, why the pagination returns duplicate records that already returned in the previous pages? Is there something wrong in my query?
1 Answer
Reset to default
0
Unfortunately I don’t have an answer, but wanted to mention that I’ve come across the same issue when using the Salesforce REST API to pull down records from a custom Data Extension. As soon as I call back to get page 2 (or 3, or 4, etc), I start to get a few duplicate records that were returned on the previous page.
I ended up updating the code that makes the calls to the API to handle/remove duplicates. I’m surprised there aren’t more people having this issue.