I have an issue with paging not working correctly....
# orm-help
v
I have an issue with paging not working correctly. I have a datamodel like
Copy code
type User {
    id: ID! @unique
    numFollowers: Int! @default(value: "0")
}
I then try to run a query like:
Copy code
return ctx.db.query.users({
                orderBy: "numFollowers_DESC",
                after: afterId,
                first: pageSize
            });
But if i run with an
afterId
that's not null I don't get valid results. I sometimes get duplicates, sometimes nothing
👍 1
n
can you reproduce this when running a
cURL
statement against the Prisma API directly?
v
Yes
Copy code
curl '<http://localhost:4466/prisma/dev>' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: <http://localhost:4466>' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7InNlcnZpY2UiOiJwcmlzbWFAZGV2Iiwicm9sZXMiOlsiYWRtaW4iXX0sImlhdCI6MTUzODc1MDU3NiwiZXhwIjoxNTM5MzU1Mzc2fQ.P6FJ9MmKyW7bE8aomw05eXxAlGSmmJ5LL7Q4fiwaSGk' --data-binary '{"query":"query users {\n  users(where:{},\n  orderBy:numFollowers_DESC,\n  after: \"cjmw39yfr00rq0915nlqoumho\",\n  first: 3) {\n    id\n    name\n    subtitle\n    numFollowers\n  }\n}","variables":{"date":"2018-09-08T10:19:10.537Z"}}' --compressed
This is running from prisma playground
Prisma
1.17.1
n
Great. Could you share your datamodel, some seed data, the expected behaviour and the actual behaviour in a new bug report using this template: https://github.com/prisma/prisma/issues/new?template=bug_report.md? 🙂
let me know if there's more to add
n
just commented there 👍