get-convex / get-convex/workflow
Add inline query and mutation blocks
Open
enhancement
- Dominant language
- TypeScript
- Stars
- 81
- Forks
- 17
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 4
Description
```ts
await step.inlineQuery(async (ctx) => {
...
});
let id;
await step.inlineMutation(async (ctx) => {
const doc = await ctx.db.get(id); // can reference things in closure
id = doc.nextId; // can even set things in closure w/o affecting determinism.
await ctx.db.patch(doc._id, { nextId: null });
});
```
to maintain determinism, we'd journal each operation in a block.
this may interact poorly with transaction size limits -- we may want to find a way to be defensive and throw an error before the workflow mutation hits the global limit.
Contributor guide
Assessment
This issue has not been assessed yet.