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 ?
4 Replies
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 exampleThe 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...
Thanks Lee for the quick response, let me try it out π
Works! Fantastic, thanks so much!
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!
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 π