remix-server icon indicating copy to clipboard operation
remix-server copied to clipboard

Local API queries in server or frontend always retrun GeneratedType type.

Open revnelson opened this issue 2 years ago • 0 comments

How can we get proper type inference on returned values using the payload Local API on the frontend?

For example, when typing req.payload.find({collection: ' within app/cms I get proper suggestions of my collections. If I were to finish that as req.payload.find({collection: 'users'}) then the return type is Promise<PaginatedDocs<User>>.

In app/server and app/web I get no suggestions and the return type is always Promise<PaginatedDocs<GeneratedTypes>>.

revnelson avatar Jul 09 '23 22:07 revnelson