Hey @Theodor_Diaconu! We’ve been working on a potential fix to our breaking recursive types in 4.3.0. The changes are included in this PR. Feel free to take a look if you’d like! There are two other small TS fixes included in that PR as well but feel free to ignore those changes.

Our solution isn’t perfect - it doesn’t provide true type safety on recursive types. Instead, it just allows recursive types to be used with the node driver (with some limitations). Three limitations to our solution are:

  • Recursive types that contain a union on the recursive parameter
  • Recursive types where the recursion isn’t a direct recursion (the recursive type needs to be a direct child property on the parent type)
  • type checking only occurs up to the first recursive call. after that, the compiler allows anything but doesn’t provide type safety

This seems to be a good balance between allowing some of the behavior we broke in 4.3 back while keeping our types maintainable for the future though.

Let us know if you have any thoughts or feedback!

2 Likes