Delveroff
CCConvex Community
•Created by Delveroff on 9/3/2024 in #support-community
How to store tree-like data?
I want to implement something like Git, where you have a tree-structure of revisions.
- Every revision has a hash (it's id)
- Every revision has a parent revision (null for the root)
- Every revision may have children revisions (like branching)
Example of such a tree:
I want to be able to fetch a revision as well as it's ancestors up to the root:
Reads are often. Writes are not, and most of them are new revisions (leafs).
For now, I see several ways of doing this:
10 replies
CCConvex Community
•Created by Delveroff on 8/9/2024 in #support-community
Wrong types for `PaginationResult`
continueCursor
should be string | null
, now it's just string
Maybe it's just testing behavior. If it is, then there's a bug in convex-test
.10 replies
CCConvex Community
•Created by Delveroff on 8/8/2024 in #support-community
A couple of questions about tsconfig
1. What's the reason of excluding the generated folder? We import modules from it anyway, just without autocomplete.
2. How to see the code that's being sent to Convex (queries, actions, etc.). I'm mostly interested in imported "shared" modules.
3. Is it okay to include
../**/*
? Of course, excluding node_modules
etc.
The motivation for these questions is because I consider moving Convex's tsconfig to the root:
That way, I could be able to freely share any code. The base config I mentioned above contains most of the options that's common between my App and Convex.11 replies
CCConvex Community
•Created by Delveroff on 8/4/2024 in #support-community
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.
I even tried to do the following, but without success:
Maybe I'm missing something but it's really unclear what to do with the api/sign-in
route.
Also, I'm acknowledged that auth.js
, especially next-auth
, tells us to create these routes. But since Convex Auth docs doesn't mention it, I'm not sure if these two approaches will conflict.55 replies
CCConvex Community
•Created by Delveroff on 7/31/2024 in #support-community
Schema Intersection
I try to create the following model:
I've read about unions at the top level here: https://docs.convex.dev/database/schemas#unions
However, as you can see, I need the status field that is true for all asset types. I tried to do this:
For now, I can't understand how to implement the aforementioned type. Seems like it lacks
v.intersection()
API.8 replies