Convex Community

CC

Convex Community

Join the community to ask questions about Convex Community and get answers from other members.

Join

support-community

show-and-tell

general

self-hosted

announcements

How can I avoid explicitly defining type in TypeScript for a internal call query handler?

I'm loving Convex <3, and I'd like to simplify my code. I have a query handler where I define a specific response type, but I want TypeScript to automatically infer the return type, instead of explicitly specifying something like GetMeResponse | null. Here’s an example of my current implementation: ```typescript...

sign in as user ?

with convex auth, how do i sign in as user. its for the usecase where admins need to debug what is happening to user's account....

How to cancel a mutation when network is down

Take the convex-tutorial (the chat app), run it, use your dev tools to make the app Offline, type a message in the app, and hit Enter. Nothing will happen until the app comes back online. Would there be a way to cancel the mutation after 30 seconds, so we can display an error message to the user, instead of leaving them hanging for a indefinite time? (Also, just letting you know: I notice a high CPU consumption during the whole time the app is offline.)...

No query type safety

Hello, I'm having trouble with why I'm not seeing proper type safety. In my code: ```tsx const objects = useQuery(api.schema.objects.getObjects);...
No description

Is this typically a bad practice? v.union(v.id("thisList"), v.id("thatList"))

I have two different types of lists that a user can select to take a singular action on (in my case, send emails). I have a list of contacts that is a "segment", or a user can select the entire "list". A list is different from a segment, but the same action can be taken on both for all practical purposes. I have my schema like this:...

sign in link and password sign up creates two separate users

I need help with this one. How do i merge the two sign up method so that it detects its the same email

Narrowing function return type

Hi, consider the toy example below: passing true as an argument causes the function to return a number while passing false causes it to return a boolean. The inferred return type is however always number | boolean regardless of what argument is passed. I guess this is just a quirk with TS not narrowing function signature based on arguments passed. Is it possible to achieve this however in an elegant way? 🙂 ```...

Generate same OTP code for demo account for app store reviewing purposes? (Convex Auth)

Can I make a certain account such as demo@gmail.com to have a same OTP code each time, so that reviewers on the app store reviewing our app can use the same OTP credentials?

Monorepo

I want to build an app and use Convex for both the mobile and web versions. I’m new to using monorepos and came across a monorepo template—does it work with the latest updates? Can I use it as is, or will it require significant updates?

Data center locations

I'm interested in using convex for an upcoming project, I am just curious: 1. Are there servers in my country (South Africa)? - If not, where is the closest data center? 2. Do I need to specify which data center to use? Or does convex do that automatically?...

two reactclient

I used convex-helpers ts-api-spec to export the api and found that there were only function definitions but no model schemas. How can I obtain the model schemas?

I want to put CODEOWNERS files in my /convex - but how?

Splitting the /convex folder into domains will be handy as the team is growing. Alread we have something like: /convex |--foobar |-- schema.ts ...

Convex Stuck Running 'npx convex dev'

When attempting to deploy to dev i encouter a timeout have tested connection and this is fine. See logs below, I get stuck at the deployment step: ``` ✔ Schema validation complete. Downloading current deployment state......

Type instantiation is excessively deep and possibly infinite.

I’m encountering the following TypeScript error in my project: Type instantiation is excessively deep and possibly infinite I’m new to TypeScript and don’t have much experience with its type system. My project has a complex directory structure with multiple levels of nesting, and I suspect the deeply nested structure might be causing the issue. ...

Filtering a many:many ENT Edge

Hey all, having some issues with filtering an edge with ents. I am on convex-ents@latest, Typescript 5.7 and convex 1.13.2. here is my query: ``` export const getEventsByTeamId = query({...

how to query all rows (recursively) ?

i need to pull all the between two dates but i need to query an estimate of 1mil++ rows. I know convex doesnt like big queries, so im guessing i need to run in recursively untill it is exhausted.

Why i load image so slow from file storage?

file size is just 661.24KB Please help me...

Set environment variables in an action

I wanted to ask if it’s possible to modify environment variables from actions or cron jobs in Convex? If this is not currently supported, are there alternative approaches to dynamically update and store configuration values at runtime, such as using a dedicated key-value store or similar mechanisms? Looking forward to your response. Thanks in advance and best regards,...