Mitak
Mitakβ€’3y ago

server-side types

Hey everyone! Loving the way convex functions work, and the various lambda easter eggs (also hi again James, Sujay and Presley! ) I'm trying to figure out how to configure type inference on server side usage of convex. Client side type inference works flawlessly in .tsx files using Next.js, but on server (meaning nextjs api) I'm getting "any" as the inferred type. Is there any info on how to set up type inference and thus also auto-completion to work when using ConvexHttpClient ?
No description
4 Replies
lee
leeβ€’3y ago
hi! you should be able to get a typed version of ConvexHttpClient by specifying the API generic. see https://blog.convex.dev/announcing-convex-0-3-0/ for an example
The Convex Blog
Announcing Convex 0.3.0
It’s time for Convex 0.3.0. This release brings many community-requested improvements and bug fixes including (details below): Deleting rows in the dashboardBreaking: Rename ConvexAPI to APITyped HTTP clientIndexed queries return results in creation time orderNew tutorial and improvements to quickstartScript tag build of the Convex npm packageIm...
Mitak
MitakOPβ€’3y ago
Thanks Lee for the quick response, let me try it out πŸ™‚ Works! Fantastic, thanks so much!
Presley
Presleyβ€’3y ago
Hi! Long time no see. We should catch up soon! Happy you are trying out Convex! Let us know if you have any questions or feedback in the meantime!
Mitak
MitakOPβ€’3y ago
Yeah, part of reason I wanted to try it because how stellar you, Sujay and James are πŸ™‚ Started with high expectations but haven't been disappointed! Will message you on LI about catching up πŸ™‚

Did you find this page helpful?