Generic Types Not Working as Expected
I'm facing an issue with generic types in a
I'm unsure if this is due to a limitation in the type inference, serialization, or something else entirely.
---
Any ideas or workarounds would be greatly appreciated!
---
PaginatedResponse setup. Here's my use case:Code Example:
The Problem:
The client-side response lacks type safety. Even though the generic typePaginatedResponse<BookingWithRelations> is correctly defined, the returned response doesn't enforce or reflect the expected type safety. I'm unsure if this is due to a limitation in the type inference, serialization, or something else entirely.
---
Question:
How can I ensure type safety is preserved in the client for such scenarios?Any ideas or workarounds would be greatly appreciated!
---