Hi there! a bit new to graphql and prisma and so f...
# orm-help
r
Hi there! a bit new to graphql and prisma and so far struggling with querying data by nested property field values. My schema:
Copy code
type User @db(name: "users")
{
  id: ID! @id
  name: String! @unique
  property: Property! @relation(link: INLINE)
}

type Property @db(name: "properties")
{
  id: ID! @id
  createdAt: DateTime! @createdAt
  updatedAt: DateTime! @updatedAt
  propertyName: String!
  users: [User!]! @relation(strategy: EMBED)
}
Currently I have this query that allows me to query users by name:
Copy code
query {
  user(where: {name: "john"}) {
    id,
    name,
    property {
      propertyName
    }
  }
}
But what I need is: to extend it to include
filter
by
propertyName
and seems like prisma's generator is not creating relational filters for me as in this example: https://www.prisma.io/forum/t/graphql-query-structure-how-can-i-return-a-deeply-nested-array-up-top/455/2 pls halp 🙏
small update -> I do can query properties by user, but not user by properties
cuz of
@relation(strategy: EMBED)
in Property
but prisma generator would throw if I use same on user agains
Property!
relation
due to circular dependency perhaps..
n
Hey @Roman Z. 👋 It seems to me like you're using the MongoDB connector, is that correct? If so, it's a known limitation that relational filter don't yet work: https://github.com/prisma/Mongo-Connector-Preview/blob/master/README.md#other
r
ugh, I see and yes you are correct for mongo and thanks a lot for that link @nikolasburk 🙂
🙌 1