Convex Community

CC

Convex Community

Join the Convex Discord! Explore Convex, the fullstack TypeScript platform for developers and startup founders.

Join

support-community

show-and-tell

general

open-source

announcements

Does defineEntSchema have a way to set strictTableNameTypes: false ?

In the process of converting my schema.ts to use Convex Ents, I am getting an npx convex dev error for a table I had not previously defined in defineSchema(): Argument of type '"tableName"' is not assignable to parameter of type 'TableNamesInDataModel Adding strictTableNameTypes: false to my defineEntSchema() causes problems in functions.ts:...

Why sometime ents one-to-one with optional: true work, sometimes not?

so my schema is this: ``` wallets: defineEnt({ privateKey: v.string(),...

Is there a way to run some code just after user is created?

If yes then when and where? Is there a way to "listen" when new user or some new entry in table is created?

Using TypeScript for Frontend and Python for Backend

Hey everyone! I have a question about this section that says "Improved Typescript Skill" . I'm wondering if it's okay to use TypeScript exclusively for the frontend while using Python for the backend. Do I need to build the entire stack with TypeScript, or can I focus on TypeScript for the frontend and Python for the backend separately?
No description

Where to store api helper utils?

Was looking where i store api utils that i want to format response or do some shared util checking etc.. without them being generated into the api files

Roles / Permission modeling (Ent Tables)

Hi, I'm pretty new with backend paradigm but i'm a seasoned frontend dev. Convex enables me to do stuff that would take me a lot of time learning with traditional backend programming - i'm am grateful for it. So my question is, is there a better way to do this Role / Permission using Ent edges instead of foreign keys? What's the common best practice and pattern I should know....
No description

using zod schema for validation

```typescript import { z } from "zod"; import { NoOp } from "convex-helpers/server/customFunctions"; import { zCustomMutation } from "convex-helpers/server/zod"; import { mutation } from "./_generated/server";...

ConvexAuth+Next.js: should I implement `/api/sign-in`?

I try to set up ConvexAuth+Next.js. When I call useAuthActions().signIn('resend', formData), I see that the request goes to my server's api/sign-in, which is 404. I read here that this is the default value. However, the docs does not mention that I have to configure this route somehow. I thought this is handled by convexAuthMiddleware, but this isn't true....

500 Status code when provisioning

Got an error while attempting to run npx convex dev:
Error fetching POST https://provision.convex.dev/api/create_project 500 Internal Server Error: InternalServerError: Your request couldn't be completed. Try again later.
Error fetching POST https://provision.convex.dev/api/create_project 500 Internal Server Error: InternalServerError: Your request couldn't be completed. Try again later.
...

Error: Unexpected type of undefined

In my nextjs app, I'm using preloadQuery to load and render a query inside a Server Component: ```typescript ... // this is a server component const localesQuery = preloadQuery(api.locales.get.default, {...
No description

can I use convex auth with hono?

There is no such example convex auth and hono.

Nodemailer as external package not working

Hi all! I have a project using nodemailer in a Node Action environment, but I'm getting this error:
✘ [ERROR] Could not resolve "nodemailer"...

Zod convex helpers build error

Getting this error when running npm run build on nextjs app ```Type error: Type '{ [Index in keyof T]: T[Index] extends ZodTypeAny ? ConvexValidatorFromZod<T[Index]> : never; }' does not satisfy the constraint 'Validator<any, "required", any>[]'. Types of property 'length' are incompatible. Type 'T["length"] extends ZodTypeAny ? ConvexValidatorFromZod<T["length"]> : never' is not assignable to type 'number'....

Best way to call an `authenticatedQuery` from another `authenticatedQuery`

I've defined a customQuery as follows: ```ts export const authenticatedQuery = customQuery( queryRaw, // The base function we're extending {...

ConvexAuthNextjsServerProvider not available

I already on the latest version, the module not found
No description

[Module: server/TS]: Generic query pipelining

Hello, I am trying to build a custom react hook that contains a "pipeline" of Convex functions. The pipeline is simple: Query A returns an array of Id<Table>, and Query B accepts an array of Id<Table> and enriches them (basically performing joins with other tables): () => getDocumentIds --> (Ids) => enrichDocuments(Ids) I want to make this hook generic such that it can be used with any compatible getter/enrichment function pair, e.g. both getVideoIds --> enrichVideos and getChannelIds --> enrichChannels. Therefore, the return type of Query A must be compatible with the parameter type of Query B. I have taken inspiration from the implementation of useQuery and have actually made it work in practice, but not without ignoring a TS error - not very peace of mind-y. I found that specifying Args in the FunctionReference of QueryB approximated the solution, but I had to manually specify the correct object key (e.g. "videoIds"). Is there a way to use some placeholder as such?: { PLACEHOLDER: FunctionReturnType<BaseQuery> }...
No description

Convex Auth e2e test with Playwright

I currently use the Email OTP provider, I couldn't figure a way to get verification code within the test environment without exposing this code somewhere in memory that is globally available but unsafe. Migrating from Clerk, Clerk solved this by doing 2 things - Every email login with clerk_test in the email is treated as a fake user.... For example michael+clerk_test@example.com - Every user with that kind of email address can verify auth with 424242 (This code works for only users with clerk_test in their email...

How to use mutations with Remix actions

Hey all. I'm pretty new to Remix and Convex but wanting to build something with it. Trying to use actions in Remix to call a Convex mutation to insert form data into a table. I can't find much info about using mutations outside of useMutation, which does not work in an action. Any pointers on how to pull this off? Thanks! (PS: No rush, I'm signing out for a few hours)...

CONVEX_DEPLOY_KEY monorepo

trying to deploy a Vite project from vercel I have a monorepo, because I also have native project I can't figure out what the right command ...

How to return id from db in my case

i use this code for write embeddings in my database:
const res = await ConvexVectorStore.fromDocuments(splitDocs, embeddings, { ctx });
const res = await ConvexVectorStore.fromDocuments(splitDocs, embeddings, { ctx });
Logic my app is - get id some embedding and pass it in Langchain context . But i need get id its embeddings from db - variable res don`t give me this info. How to do this?...