Export PaginatedDocs #9547
edtorba
started this conversation in
Feature Requests & Ideas
Replies: 1 comment 1 reply
-
You can perfectly fine install the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone!
I wanted to start a discussion about the possibility of including the
PaginatedDocs
type in the generatedpayload-types.ts
file. Since many responses from Payload CMS collections are paginated, having a genericPaginatedDocs<T>
type automatically included could streamline development and ensure consistency. This type, which includes properties like docs, totalDocs, limit, totalPages, page, etc., is widely applicable and would save developers from manually defining it or adding it to separate utility files.This becomes especially practical in setups where the Payload CMS (head) is separate from the client-facing site, and the generated payload-types.ts file is part of an independent package (e.g., @repo/head-types). Including PaginatedDocs in the generated models would make it easier to share a complete and reusable type system across projects without additional manual work.
Would it make sense to incorporate PaginatedDocs as a standard part of the type generation process? Looking forward to hearing thoughts from the team and the community!
Beta Was this translation helpful? Give feedback.
All reactions