Prisma1: Can't query accross relationship

Created on 28 Dec 2018  路  3Comments  路  Source: prisma/prisma1

Describe the bug
Trying to find a Node by reference of other node, like mentioned in the docs (4th example in this section)

QUERY:

query {
  campaigns(where: { partner: { imdeId: "loremipsum" } }) {
    id
    partner {
      imdeId
    }
  }
}

RESULT:

{
  "data": null,
  "errors": [
    {
      "message": "Argument 'where' expected type 'CampaignWhereInput' but got: {partner: {imdeId: \"loremfuckingipsum\"}}. Reason: 'partner' Field 'partner' is not defined in the input type 'CampaignWhereInput'. (line 2, column 20):\n  campaigns(where: {partner: {imdeId: \"loremfuckingipsum\"}}) {\n                   ^\n (line 2, column 21):\n  campaigns(where: {partner: {imdeId: \"loremfuckingipsum\"}}) {\n                    ^",
      "locations": [
        {
          "line": 2,
          "column": 20
        },
        {
          "line": 2,
          "column": 21
        }
      ]
    }
  ]
}

SCHEMA:

type Campaign {
  id: ID! @id @unique
 ...
  partner: Partner  @relation(name: "CampaignOwner")
}

type Partner {
  id: ID! @id @unique
  imdeId: String @unique
  campaigns:[Campaign] @relation(name: "CampaignOwner", link: INLINE)
}

Versions (please complete the following information):

  • OS: Ubuntu 18.04
  • prisma CLI: prisma/1.22.2 (linux-x64) node-v10.14.1
  • "prisma-client-lib": "^1.22.2"
  • prisma-binding : 2.2.11
kinquestion areconnectomongo

Most helpful comment

Hi @FinnFrotscher,

From the schema that you have shared, I can infer that you are using the mongo connector.

Relational filters for MongoDB are in beta currently, so please use the version 1.24-beta image in your docker-compose file.

All 3 comments

Hi @FinnFrotscher,

From the schema that you have shared, I can infer that you are using the mongo connector.

Relational filters for MongoDB are in beta currently, so please use the version 1.24-beta image in your docker-compose file.

solved.

I'm still getting this on 1.26.5 (I can't go to 1.28 because it has an error with MongoDB Atlas). Where can I track when this feature will be added to the production branch? It's included in the docs for 1.26 so I assume it should work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jannone picture jannone  路  3Comments

ragnorc picture ragnorc  路  3Comments

tbrannam picture tbrannam  路  3Comments

akoenig picture akoenig  路  3Comments

marktani picture marktani  路  3Comments