[Convex Ents](bug): One to many edge with weird type

my schema looks like that
const schema = defineEntSchema({
// other ents

messages: defineEnt({})
// some fields
.edges("reactions", { ref: true })
// some edges
}),

reactions: defineEnt({})
// some fields and edges
.edge("message"),
});
const schema = defineEntSchema({
// other ents

messages: defineEnt({})
// some fields
.edges("reactions", { ref: true })
// some edges
}),

reactions: defineEnt({})
// some fields and edges
.edge("message"),
});
and I'm querying the data like that:
await message.edge("reactions"),
await message.edge("reactions"),
but as a type I get this back
(property) reactions: Ent<"reactions", {
_id: Id<"reactions">;
_creationTime: number;
emoji: string;
userId: Id<"users">;
messageId: Id<"messages">;
}, EntDataModelFromSchema<SchemaDefinition<{
privateChats: EntDefinition<VObject<{
support: boolean;
}, {
...;
}, "required", "support">, {}, {}, {}, {
...;
} & ... 1 more ... & {
...;
}>;
users: EntDefinition<...>;
clearRequests: EntDefinition<...>;
messages: EntDefinition<...>;
reactions: EntDefinition<...>;
}, true>>>[]
(property) reactions: Ent<"reactions", {
_id: Id<"reactions">;
_creationTime: number;
emoji: string;
userId: Id<"users">;
messageId: Id<"messages">;
}, EntDataModelFromSchema<SchemaDefinition<{
privateChats: EntDefinition<VObject<{
support: boolean;
}, {
...;
}, "required", "support">, {}, {}, {}, {
...;
} & ... 1 more ... & {
...;
}>;
users: EntDefinition<...>;
clearRequests: EntDefinition<...>;
messages: EntDefinition<...>;
reactions: EntDefinition<...>;
}, true>>>[]
which makes me get reactions with edge, edgeX and doc which I dont want but I only want this type (without edge, edgeX and doc)
(property) reactions: Ent<"reactions", {
_id: Id<"reactions">;
_creationTime: number;
emoji: string;
userId: Id<"users">;
messageId: Id<"messages">;
}, & EntInstance<EntDataModelFromSchema<SchemaDefinition<...>>, "reactions">
(property) reactions: Ent<"reactions", {
_id: Id<"reactions">;
_creationTime: number;
emoji: string;
userId: Id<"users">;
messageId: Id<"messages">;
}, & EntInstance<EntDataModelFromSchema<SchemaDefinition<...>>, "reactions">
2 Replies
Convex Bot
Convex Bot•4w ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
FleetAdmiralJakob 🗕 🗗 🗙
Ah ok, using
await message.edge("reactions").docs(),
await message.edge("reactions").docs(),
fixed my issue