export const authedMutation = customMutation(mutation, {
args: traceArgsValidator,
input: async (ctx, args) => {
const startTime = Date.now();
const event = createWideEventBuilder({ /* ... */ });
return {
ctx: { auth, authz, event, _startTime: startTime },
args: handlerArgs,
onSuccess: () => {
// :white_check_mark: This works great for success path
event.set("function.status", "success");
emitWideEvent(event);
},
};
},
});
export const authedMutation = customMutation(mutation, {
args: traceArgsValidator,
input: async (ctx, args) => {
const startTime = Date.now();
const event = createWideEventBuilder({ /* ... */ });
return {
ctx: { auth, authz, event, _startTime: startTime },
args: handlerArgs,
onSuccess: () => {
// :white_check_mark: This works great for success path
event.set("function.status", "success");
emitWideEvent(event);
},
};
},
});