kensho-technologies/graphql-compiler

Postgres backend produces incorrect results for empty fold lists

Closed this issue · 2 comments

Turning on integrations tests in #953 uncovered a bug. This db-fiddle is modeled after the current output of this integration test. For Animal 4, we expect to see the result {child_names: []}, but instead get no results for Animal 4.

I think this can be solved with a LEFT JOIN from the main selectable to the folded subquery? That is actually what we have written up in #535, but in implementation we used a JOIN instead. See this db-fiddle. If so, the fix is a super easy change here! @bojanserafimov @obi1kenobi let me know what you think!

Looks good to me! Let's go for it 🙌