unselected attribute used in relationship filter + aggregate results in column does not exist error
I'm not sure at what level of the stack this bug is happening, but I suspect it's at the ash_sql level.
I have an ltree based resource. I decided to use relationships/calculations to abstract some of the ltree details away, so I have a
I then have this aggregate:
Using ash_graphql, I grab some resources like this (note I do not select
This results in the following error from postgres:
It seems like at some point, ash loses track of the fact it needs to include the
I have an ltree based resource. I decided to use relationships/calculations to abstract some of the ltree details away, so I have a
children relationship that looks like this (level is the ltree column, and nlevel is a calculation that is just nlevel(level)):I then have this aggregate:
Using ash_graphql, I grab some resources like this (note I do not select
level):This results in the following error from postgres:
** (Postgrex.Error) ERROR 42703 (undefined_column) column s0.level does not existIt seems like at some point, ash loses track of the fact it needs to include the
level field in the SQL select so that it can correlate the relationship to it, even though it doesn't need to be included in the gql response.