graphile / crystal

🔮 Graphile's Crystal Monorepo; home to Grafast, PostGraphile, pg-introspection, pg-sql2 and much more!
https://graphile.org/
Other
12.62k stars 571 forks source link

Rewrite OutputPlans, they're a mess #2123

Open benjie opened 4 months ago

benjie commented 4 months ago

We can do this after V5 goes live, but with the new system of unaries and flags, the OutputPlan logic should be revised fully. In #2118 I rewrote from the eval'd JS to TS, but the resulting TS is an absolute mess because the eval'd code worked in a way that only eval'd JS could, so now we're passing many many things all around. In #2114 we then addressed the new way of checking for errors related to the output plan even if the bucket doesn't exist at runtime. There's also inefficiencies where we're checking the same things twice in different locations, and potentially there's also the risk of places where we don't check certain things at all. The aim should be that everything has a nice simple and straightforward flow, but right now the code reeks of layers upon layers of modification without a full refactor. But, due to the push to get V5 out, I'm going to have to delay this refactoring work.