hyperzone
hyperzone
Explore posts from servers
CCConvex Community
Created by hyperzone on 3/28/2024 in #support-community
'remove' in convex-ents patch not working
Sorry for bumping this, but did it get fixed?
10 replies
CCConvex Community
Created by hyperzone on 3/28/2024 in #support-community
'remove' in convex-ents patch not working
@Michal Srb Also a question, right now if I run a mutation that creates a many:many edge between 'menu' and 'item' for example, then run it again with the same menu and item ids, it creates a new menu_to_items document. Shouldn't it be like 'there's already an edge between the item and the menu so don't do anything'?
10 replies
CCConvex Community
Created by hyperzone on 3/28/2024 in #support-community
'remove' in convex-ents patch not working
Thank you it is now working 🙂
10 replies
CCConvex Community
Created by hyperzone on 3/10/2024 in #support-community
delete many in convex-ents
await Promise.all(
itemIds.map((id) =>
ctx
.table("items")
.getX(id)
.delete()
)
);
await Promise.all(
itemIds.map((id) =>
ctx
.table("items")
.getX(id)
.delete()
)
);
This snippet is the correct one because Promise.all takes only one arg. Thanks for your help!
11 replies
CCConvex Community
Created by hyperzone on 3/10/2024 in #support-community
delete many in convex-ents
I was trying to do:
const items = await ctx.table("items").getMany(itemIds); // itemIds is Id<"items">[]

await Promise.all(items.map(item => item.delete()));
const items = await ctx.table("items").getMany(itemIds); // itemIds is Id<"items">[]

await Promise.all(items.map(item => item.delete()));
11 replies
CCConvex Community
Created by hyperzone on 3/10/2024 in #support-community
delete many in convex-ents
Yeah that's what I was trying to do. The returned array consists of Ents with .edge, .edges and .doc. No delete on them. Right now I loop over the ids and query each one using .get(), then I delete them all in a Promise.all but I don't know if it's optimal
11 replies
CCConvex Community
Created by hyperzone on 3/6/2024 in #support-community
using zCustomMutation with convex-ents
Yes it makes sense thank you!
9 replies
CCConvex Community
Created by hyperzone on 3/6/2024 in #support-community
using zCustomMutation with convex-ents
I guess having name be name: v.any() ?
9 replies
CCConvex Community
Created by hyperzone on 3/6/2024 in #support-community
using zCustomMutation with convex-ents
Besides changing the mutation argument to:
name: v.array(
v.object({
key: v.string(),
value: v.string(),
})
),
name: v.array(
v.object({
key: v.string(),
value: v.string(),
})
),
will I also have to change my schema from
name: v.object({})
name: v.object({})
to an array of objects? Is it possible to have the name be an object I can push anything to? since records are not supported
9 replies
CCConvex Community
Created by hyperzone on 3/6/2024 in #support-community
using zCustomMutation with convex-ents
Thanks Ian 👍
9 replies
CCConvex Community
Created by hyperzone on 3/6/2024 in #support-community
using zCustomMutation with convex-ents
If I try to go with this:
export const zMutation = zCustomMutation(
baseMutation,
customCtx(async (baseCtx) => {
return await mutationCtx(baseCtx);
})
);
export const zMutation = zCustomMutation(
baseMutation,
customCtx(async (baseCtx) => {
return await mutationCtx(baseCtx);
})
);
wherever I try to use zMutation the context is of type 'never'
9 replies
CCConvex Community
Created by hyperzone on 3/1/2024 in #support-community
Linking teams with Clerk organizations
thanks! really like Ent thanks for your work 🙂
10 replies
CCConvex Community
Created by hyperzone on 3/1/2024 in #support-community
Linking teams with Clerk organizations
it's also the same with category -> categorie
10 replies
CCConvex Community
Created by hyperzone on 3/1/2024 in #support-community
Linking teams with Clerk organizations
I might be wrong, but I think it's not documented in the ent docs. I read it a few times and didn't see any mention of pluralization
10 replies
CCConvex Community
Created by hyperzone on 3/1/2024 in #support-community
Linking teams with Clerk organizations
thanks! I spent so much time trying to figure this out lol
10 replies
CCConvex Community
Created by hyperzone on 3/1/2024 in #support-community
Linking teams with Clerk organizations
Also I'm trying out ents and I'm getting this error:
Uncaught Error: Missing inverse edge in table "members" for edge "members" in table "businesses"
Uncaught Error: Missing inverse edge in table "members" for edge "members" in table "businesses"
for this schema:
const schema = defineEntSchema(
{
businesses: defineEnt({
name: v.string(),
organizationId: v.string(),
image: v.string(),
ownerUserId: v.string(),
})
.field("slug", v.string(), { unique: true })
.edges("members", { ref: true })
.deletion("scheduled", { delayMs: BUSINESS_DELETION_DELAY_MS }),
users: defineEnt({
// this is UserJSON from @clerk/backend
clerkUser: v.any(),
})
.index("by_clerk_id", ["clerkUser.id"])
.edges("members", { ref: true, deletion: "soft" })
.deletion("soft"),
members: defineEnt({})
.edge("business")
.edge("user")
.index("businessUser", ["businessId", "userId"])
.deletion("soft"),
},
{ schemaValidation: true }
);
const schema = defineEntSchema(
{
businesses: defineEnt({
name: v.string(),
organizationId: v.string(),
image: v.string(),
ownerUserId: v.string(),
})
.field("slug", v.string(), { unique: true })
.edges("members", { ref: true })
.deletion("scheduled", { delayMs: BUSINESS_DELETION_DELAY_MS }),
users: defineEnt({
// this is UserJSON from @clerk/backend
clerkUser: v.any(),
})
.index("by_clerk_id", ["clerkUser.id"])
.edges("members", { ref: true, deletion: "soft" })
.deletion("soft"),
members: defineEnt({})
.edge("business")
.edge("user")
.index("businessUser", ["businessId", "userId"])
.deletion("soft"),
},
{ schemaValidation: true }
);
I built this schema following the saas starter and for some reason this error pops up
10 replies
CCConvex Community
Created by hyperzone on 2/27/2024 in #support-community
Using clerk sdk inside a mutation
it works, thank you 🙂
7 replies
CCConvex Community
Created by hyperzone on 2/27/2024 in #support-community
Using clerk sdk inside a mutation
yes you're right about the filesystem, I'll try adding the env vars
7 replies
TTCTheo's Typesafe Cult
Created by Debaucus on 7/30/2023 in #questions
Looking for NextAuth Discord Refresh token rotation examples. All mine have expired.
hey @debaucus , did you manage to find an implementation?
8 replies
TTCTheo's Typesafe Cult
Created by hyperzone on 6/16/2023 in #questions
Caching ORM response in Next app dir
That's exactly what I do here and my point is that it's not working
4 replies