Closed tbdsux closed 1 month ago
Property 'after' does not exist on type 'QuerySuccess<Page>'
I found the use of Page<T> from: https://github.com/fauna/js-sample-app
Page<T>
const res = await client.query<T>(query) res.after // type error: 'Property 'after' does not exist on type 'QuerySuccess<T>''
Checking the types: QuerySuccess does not have after field while Page has after
QuerySuccess
after
Page
UPDATE: After more trying, seems to be the return types are just correct. I thought .after was available without having to use Page<T> like: res.after
.after
res.after
const res = await client.query<Page<T>>(query) // need to use Page<> res.data.data // data res.data.after // nextToken
Hi @tbdsux You nailed it! Thank for the submission. Please don't hesitate to reach out if you catch anything else.
Property 'after' does not exist on type 'QuerySuccess<Page>'
I found the use of
Page<T>
from: https://github.com/fauna/js-sample-appChecking the types:
QuerySuccess
does not haveafter
field whilePage
hasafter
UPDATE: After more trying, seems to be the return types are just correct. I thought
.after
was available without having to usePage<T>
like:res.after