fix: Add a hint and clarification to the no relationship found error (#1858)

This commit is contained in:
laurenceisla
2021-05-31 12:15:31 -05:00
committed by GitHub
parent 88a481da8a
commit 1b12b112a1
3 changed files with 15 additions and 6 deletions
+4 -2
View File
@@ -225,8 +225,10 @@ spec actualPgVersion = do
get "/items?always_false=is.false" `shouldRespondWith` 400
it "matches filtering nested items 2" $
get "/clients?select=id,projects(id,tasks2(id,name))&projects.tasks.name=like.Design*"
`shouldRespondWith` [json| {"message":"Could not find foreign keys between these entities. No relationship found between projects and tasks2"}|]
get "/clients?select=id,projects(id,tasks2(id,name))&projects.tasks.name=like.Design*" `shouldRespondWith`
[json| {
"hint":"If a new foreign key between these entities was created in the database, try reloading the schema cache.",
"message":"Could not find a relationship between projects and tasks2 in the schema cache"}|]
{ matchStatus = 400
, matchHeaders = [matchContentTypeJson]
}