Static code generation <> WorkflowId
I found the Static code generation section in the docs (https://docs.convex.dev/production/project-configuration#using-static-code-generation-beta) which looks like exactly what I need. I tried it out and for the most part it works perfectly.
There is however an issue when paired with
@convex-dev/workflow. Code generation does not work as expected for the vWorkflowId validator. I am typing my schema as follows:When I try to query this table without SCG, the type is as expected:
However, with SCG the type becomes a string:
As far as I can tell this make it unusable at the moment because I have type errors in all places where I use the
vWorkflowId validator and the WorkflowId type. Since this type is coming directly from ctx.db.query I am not sure how to work around it. Note that this issue is observed also in convex function arguments, which makes it impossible to correctly pass a function handler in the onComplete callback of workflows, since the onComplete expects workflowId: vWorkflowId but the resulting type from a function this argument resolves to workflowId: string after the Static Code Generation.Overall this feature is very much needed as codebases are becoming larger, this is the only issue I observed so far that is preventing me from using it.

