get-convex / get-convex/workflow

Add inline query and mutation blocks

Open
#17 0 comments 3 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.