Skip to content

Conversation

@ianmacartney
Copy link
Contributor


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ianmacartney ianmacartney changed the base branch from main to ian/nested-workflow October 24, 2025 03:16
Comment on lines +10 to +11
})
.handler(async (ctx, args) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fyi @thomasballinger fluent definitions work well and break the circular type errors.
I even made this an overload so you can keep providing the handler inline, or upgrade to fluent. but the overload makes for uglier type errors (the overload 1 / 2 wording, maybe not a big deal).
The other syntax I could imagine doing - which we can do in convex too - is workflow.define.args().returns().handler().
So one version we could use in convex would be:

export const myquery = query({ args, returns }).handler(async () => {});

Another would be:

export const myquery = query.args().returns().handler(async() => {});

The latter could avoid overloads.
or even query.define({ args, returns }).handler(async() => {}); - if we want to have an object to be able to add more things, e.g. the custom function extra args pattern I like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant