Vincit / objection-graphql

GraphQL schema generator for objection.js
MIT License
307 stars 34 forks source link

Ambiguous reference to the column when using join #8

Closed nasushkov closed 7 years ago

nasushkov commented 7 years ago

Hi, I've got an error

Ambiguous reference to the column "id"

for the following GraphQL query (I use PostgreSQL):

{
      residentialComplexs {
        id,
        name,
        blocks {
          id, 
          name,
          address,
          layouts {
            id
          }
        }
      }
    }

Here is the query, which was generated and fails with the error select "block_layout"."block_id" as "objectiontmpjoin0", "id" from "layout" inner join "block_layout" on "block_layout"."layout_id" = "layout"."id" where "block_layout"."block_id" in ($1, $2, $3, $4)

Looks like that explicit table prefix "layout" before "id" can solve the problem. It used to work for the previous version.

koskimas commented 7 years ago

Thanks for bringing this up. I'll fix this right away and publish a new version.