AlphaOmega
AlphaOmega
CCConvex Community
Created by AlphaOmega on 4/5/2025 in #support-community
TS2589: Type instantiation is excessively deep and possibly infinite.
I can remove that dependency, not ideal though
15 replies
CCConvex Community
Created by AlphaOmega on 4/5/2025 in #support-community
TS2589: Type instantiation is excessively deep and possibly infinite.
Yes they utilize Doc
15 replies
CCConvex Community
Created by AlphaOmega on 4/5/2025 in #support-community
TS2589: Type instantiation is excessively deep and possibly infinite.
That didnt fix it, i typed out all my run calls ( not a lot btw ) and typed out the returns of every function in my model directory Here is an example
export const getMyParkingLots = withAuthenticatedQueryContext(
async (ctx): Promise<ParkingLot.ParkingLotPreview[]> => {
const parkingLots = await ParkingLot.getByUser(ctx, {
userId: ctx.user._id,
});

return pruneNull(
await Promise.all(
parkingLots.map(({ _id }) =>
ParkingLot.getPreviewById(ctx, { id: _id })
)
)
);
}
);
export const getMyParkingLots = withAuthenticatedQueryContext(
async (ctx): Promise<ParkingLot.ParkingLotPreview[]> => {
const parkingLots = await ParkingLot.getByUser(ctx, {
userId: ctx.user._id,
});

return pruneNull(
await Promise.all(
parkingLots.map(({ _id }) =>
ParkingLot.getPreviewById(ctx, { id: _id })
)
)
);
}
);
export const getMyParkingLots = authenticatedQuery({
args: {},
handler: Provider.getMyParkingLots,
});
export const getMyParkingLots = authenticatedQuery({
args: {},
handler: Provider.getMyParkingLots,
});
every function in my project is like this, every call to ctx.run_ whose returns is used
export const book = withAuthenticatedActionContext(
async (
ctx,
{
parkingLotId,
vehicleId,
slot,
}: {
parkingLotId: Id<"parkingLots">;
vehicleId: Id<"vehicles">;
slot: Slot;
}
): Promise<{ booking: Booking; paymentIntent: Payment.PaymentIntent }> => {
const ongoingBookings: Doc<"bookings">[] = await ctx.runQuery(
internal.services.booking.getOngoing,
{
userId: ctx.user._id,
}
);

const conflictsWithRequestedSlot = hasConflict(ongoingBookings, slot);

if (conflictsWithRequestedSlot) {
throw new ConvexError(BookingError.ACTIVE_BOOKING_EXISTS);
}
export const book = withAuthenticatedActionContext(
async (
ctx,
{
parkingLotId,
vehicleId,
slot,
}: {
parkingLotId: Id<"parkingLots">;
vehicleId: Id<"vehicles">;
slot: Slot;
}
): Promise<{ booking: Booking; paymentIntent: Payment.PaymentIntent }> => {
const ongoingBookings: Doc<"bookings">[] = await ctx.runQuery(
internal.services.booking.getOngoing,
{
userId: ctx.user._id,
}
);

const conflictsWithRequestedSlot = hasConflict(ongoingBookings, slot);

if (conflictsWithRequestedSlot) {
throw new ConvexError(BookingError.ACTIVE_BOOKING_EXISTS);
}
is explicitly typed, and yet, when using internal or api i get the type instantiation error
15 replies
CCConvex Community
Created by AlphaOmega on 4/5/2025 in #support-community
TS2589: Type instantiation is excessively deep and possibly infinite.
Ok ill look into where i mightve called them
15 replies
CCConvex Community
Created by AlphaOmega on 4/5/2025 in #support-community
TS2589: Type instantiation is excessively deep and possibly infinite.
would me typing out the returns validator on each function fix this?
15 replies
CCConvex Community
Created by AlphaOmega on 4/5/2025 in #support-community
TS2589: Type instantiation is excessively deep and possibly infinite.
It's a different issue, this is about type complexity and I dont get it on the return value, that's actually correct, i get it on the internal or api import itself
15 replies
CCConvex Community
Created by Nic on 3/30/2025 in #support-community
Searching two columns
A computed values helper defined when defining the table ( much like indexes ) would be so much better. Triggers do work but it also seems like too much hassle for such a simple concept
8 replies
CCConvex Community
Created by AlphaOmega on 3/21/2025 in #support-community
Why no unions as function validators?
I have a schemas folders where i have defined my schemas, and from time to time i need internal update or create mutations, where i basically just have a one liner db.insert call, for a few tables i can do this through importing the already defined schemas, which works great for object tables, for other tables that are unions in a db level, i lose that abolity
14 replies
CCConvex Community
Created by AlphaOmega on 3/21/2025 in #support-community
Why no unions as function validators?
So { args: v.union(…) } Doesnt work
14 replies
CCConvex Community
Created by AlphaOmega on 3/21/2025 in #support-community
Why no unions as function validators?
Nested inside object validatiors works fine
14 replies
CCConvex Community
Created by AlphaOmega on 3/21/2025 in #support-community
Why no unions as function validators?
You can use them but not at the root level
14 replies
CCConvex Community
Created by AlphaOmega on 3/21/2025 in #support-community
Why no unions as function validators?
When you run dev it tells you validators must be serialisable and it seems unions arent
14 replies
CCConvex Community
Created by AlphaOmega on 3/21/2025 in #support-community
Why no unions as function validators?
Function validators as it stands right now cannot be set to v.union
14 replies
CCConvex Community
Created by AlphaOmega on 3/26/2025 in #support-community
Dev deployment is a lot faster than a production one
No I actually have less
6 replies
CCConvex Community
Created by Eva on 3/17/2025 in #support-community
Why is calling Convex queries/mutations directly an anti-pattern?
which now that im thinking about it should be used here instead of duplicating ctx.db. but thats a small thing
46 replies
CCConvex Community
Created by Eva on 3/17/2025 in #support-community
Why is calling Convex queries/mutations directly an anti-pattern?
and its equivalent in ts function form
46 replies
CCConvex Community
Created by Eva on 3/17/2025 in #support-community
Why is calling Convex queries/mutations directly an anti-pattern?
46 replies
CCConvex Community
Created by Eva on 3/17/2025 in #support-community
Why is calling Convex queries/mutations directly an anti-pattern?
yeah i also have a schemas folder that i use which also includes common validators so i don't have to explicitly type things out, but yeah its still a bit of a miss
46 replies
CCConvex Community
Created by Eva on 3/17/2025 in #support-community
Why is calling Convex queries/mutations directly an anti-pattern?
@erquhart what do you guys suggest about params, with having things in separate files, you do lose the type inference from the validator, should we create validators and export them from model/ files so we can Infer<typeof validator> and have total type equality?
46 replies
CCConvex Community
Created by Eva on 3/17/2025 in #support-community
Why is calling Convex queries/mutations directly an anti-pattern?
but its fine honestly, if yall know it to be better than im sure its better
46 replies