fix: aliasing on computed rels

This commit is contained in:
steve-chavez
2022-10-19 19:49:43 -05:00
committed by Steve Chavez
parent c8b39c6cde
commit 7ace8ace49
6 changed files with 56 additions and 15 deletions
@@ -107,3 +107,12 @@ spec = describe "computed relationships" $ do
get "/second_1?select=*,first_1(*)"
`shouldRespondWith`
[json|[]|] { matchHeaders = [matchContentTypeJson] }
-- https://github.com/PostgREST/postgrest/issues/2455
it "creates queries with the right aliasing" $ do
get "/fee?select=*,jsbaz(*,janedoe(*))"
`shouldRespondWith`
[json|[]|] { matchHeaders = [matchContentTypeJson] }
get "/fee?select=*,jsbaz(*,johnsmith(*, fee(*)))"
`shouldRespondWith`
[json|[]|] { matchHeaders = [matchContentTypeJson] }