[Convex Ents] ctx in mutation does not have a runMutation or runQuery function

Hi, I currently have my mutation defined as:
export const mutation = customMutation(
baseMutation,
customCtx(async (ctx) => {
return {
table: entsTableFactory(ctx, entDefinitions),
db: undefined,
};
}),
);
export const mutation = customMutation(
baseMutation,
customCtx(async (ctx) => {
return {
table: entsTableFactory(ctx, entDefinitions),
db: undefined,
};
}),
);
and the ctx object of this does not have a function called runMutation or runQuery to call a internal mutation or query as defined here: https://docs.convex.dev/functions/internal-functions#calling-internal-functions
Internal Functions | Convex Developer Hub
Internal functions can only be called by other functions
5 Replies
FleetAdmiralJakob 🗕 🗗 🗙
I found this guy using it without any problem so idk if that is a problem by me: https://github.com/deankerr/e-suite/blob/7df7b371cc48f5f5e796841e8c4031beddb2ea4f/convex/lib/sharp.ts#L47
GitHub
e-suite/convex/lib/sharp.ts at 7df7b371cc48f5f5e796841e8c4031beddb2...
Contribute to deankerr/e-suite development by creating an account on GitHub.
FleetAdmiralJakob 🗕 🗗 🗙
My convex versions are the latest and greatest you can get: "convex": "^1.12.1", "convex-ents": "^0.7.6", "convex-helpers": "^0.1.41",
Michal Srb
Michal Srb•7mo ago
You're defining a mutation, but only actions can call other functions?
FleetAdmiralJakob 🗕 🗗 🗙
Ok, I thought that this means that I can call it from every function. Maybe you can improve that
No description
Michal Srb
Michal Srb•7mo ago
Good point, I can fix make that clearer