#convex/server doesn't export paginationResultValidator

1 messages · Page 1 of 1 (latest)

compact aurora
#

Despite it being in the API reference convex/server doesn't seem to export the paginationResultValidator which is useful for using in the returns parameter when returning paginated results?

timid orbitBOT
#

Hi @compact aurora. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the knowledge sources, I can confirm that paginationResultValidator is documented in the API reference for the server module. According to the API documentation, paginationResultValidator is a validator factory for PaginationResult that you can use to create validators for paginated query results.

However, the knowledge sources do not explicitly mention whether this validator is actually exported from convex/server or if there's a discrepancy between the documentation and the actual exports. The documentation shows it should be available at server/pagination.ts:162, but I cannot verify from the provided sources whether it's properly exported in the package.

If you're experiencing an import error, you might want to:

  1. Check if you need to import it from a different path
  2. Verify your Convex package version matches the documentation
  3. Consider using v.any() as a temporary workaround for the returns parameter, though this is less type-safe

The knowledge sources show that argument and return value validators are important for security and type safety, so having proper validators for pagination results would be valuable. If this is indeed missing from the exports, it may be worth reporting as an issue to the Convex team.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@compact aurora Kapa.ai is still learning and improving, please let me know how I did by reacting below.

compact aurora
#

@timid orbit This was added in a very recent release that I hadn't upgraded to yet, resolved!

timid orbitBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

Great! I'm glad to hear that upgrading to the latest version of Convex resolved the issue with paginationResultValidator not being exported from convex/server.

It sounds like this export was added in a recent release, so making sure you're on the latest version was indeed the solution. If you encounter any other issues or have questions about using paginationResultValidator in your paginated queries, feel free to ask!

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: