Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Types issues - Wasp
W
Wasp
•
7mo ago
•
9 replies
NEROX
Types issues
Hey Kapa
, for a
"count
"
, how will be correct
?
GetPaginatedUsers
operations
.ts
type GetPaginatedUsersOutput
=
{
users
:
(Pick
<
User
,
'id
'
|
'email
'
|
'username
'
|
'subscriptionStatus
'
|
'paymentProcessorUserId
'
|
'isAdmin
'
|
'createdAt
'
|
'hasCompletedOnboarding
'
|
'firstSeenData
'
&
{
_count
:
{
projects
: number
;
documents
: number
;
chats
: number
;
}
;
messageCount
: number
;
}
)
[
]
;
totalPages
: number
;
}
;
/
/ Calculate total message count for each user
const usersWithMessageCounts
= pageOfUsers
.map
(
(user
)
=
>
{
const messageCount
= user
.chats
.reduce
(
(total
: number
, chat
:
{
_count
:
{ messages
: number
}
}
)
=
> total
+ chat
.
_count
.messages
, 0
)
;
return
{
id
: user
.id
,
email
: user
.email
,
username
: user
.username
,
isAdmin
: user
.isAdmin
,
subscriptionStatus
: user
.subscriptionStatus
,
paymentProcessorUserId
: user
.paymentProcessorUserId
,
createdAt
: user
.createdAt
,
hasCompletedOnboarding
: user
.hasCompletedOnboarding
,
firstSeenData
: user
.firstSeenData
,
_count
: user
.
_count
,
messageCount
,
}
;
}
)
;
main
.wasp
query getPaginatedUsers
{
fn
: import
{ getPaginatedUsers
} from
"
@src
/user
/operations
"
,
entities
:
[User
, Message
, Chat
, Document
, Project
]
}
[ Wasp
] src
/user
/operations
.ts
(150
,31
)
: error TS2339
: Property
'chats
' does not exist on type
'
{ id
: string
; createdAt
: Date
; email
: string
| null
; username
: string
| null
; name
: string
| null
; isAdmin
: boolean
; jwtUserSecret
: string
| null
; lastLogoutTime
: Date
| null
;
.
.
. 9 more
.
.
.
; hasCompletedOnboardingTour
:
boolean
;
}
'
.
[ Wasp
] src
/user
/operations
.ts
(161
,20
)
: error TS2339
: Property
'
_count
' does not exist on type
'
{ id
: string
; createdAt
: Date
; email
: string
| null
; username
: string
| null
; name
: string
| null
; isAdmin
: boolean
; jwtUserSecret
: string
| null
; lastLogoutTime
: Date
| null
;
.
.
. 9 more
.
.
.
; hasCompletedOnboardingTour
: boolean
;
}
'
.
Wasp
Join
Rails-like framework for React, Node.js and Prisma. Build your app in a day and deploy it with a single CLI command.
4,650
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Types
W
Wasp / 🙋questions
15mo ago
@types delcarations
W
Wasp / 🙋questions
3y ago
Types on the Frontend
W
Wasp / 🙋questions
4y ago
CORS Issues
W
Wasp / 🙋questions
9mo ago