<@UBDCY7ED7> I've answered man <https://www.prisma...
# orm-help
c
@Gorodov Maksim I've answered man https://www.prisma.io/forum/t/filtering-subscription-for-correct-user/4262/2?u=catalinmiron. The problem with your datamodel is that you can't connect the user because there's no specified relation between the Task and the User 👍.
g
I'm trying right now to make changes you mentioned. If I understood you correctly, my models should look like this, right?
User
Copy code
type User {
  id: ID! @unique
  name: String!
  tasks: [Tasks!] @relation(name: "UserOnTask" onDelete: CASCADE)
}
Task
Copy code
type Task {
  id: ID! @unique
  user: User! @relation(name: "UserOnTask")
}
@catalinmiron nope, it doesn't work 😞
c
Not realy just add the relation only to the Task :)
Could you please add logs from the server as well? Also try codegen your datamodel before doing any operations.
I’m on the bus but once I’m at home I’ll create a repo and point it to you on the forum.
g
okay, i also messaged you in DM
And what kind of logs do you need? This?
r
@Gorodov Maksim What version of Prisma are you using?
g
@Raeesaa 1.14.2
r
Ok, subscription query that you have specified in forum should have worked in that case.
g
they work, but everybody receives them, not only the person who made an update...
r
Hmm ok. The only problem I see in query is, condition for
node
is not within
where
. That is, the parameter you pass to subscription binding should be
Copy code
{
  where: { mutation_in: ['UPDATED'], node: { user: { id: userId } } },
}
instead of:
Copy code
{
  where: { mutation_in: ['UPDATED'], }, node: { user: { id: userId } },
}
g
@Raeesaa oh my god! u r right!!!!1
🙂 1