Hyo
12/13/2018, 3:48 PM{
where: { id: userId },
data: { friends:
{ connect:
AND [
{
id: friendId
},
NOT: { id: userId }
]
} },
},
So that I don’t want to add current user as a friend inside the query.Daniel Mahon
12/13/2018, 4:20 PM{
where: { id: userId },
data: { friends: { connect: { id: friendId } } },
}
Daniel Mahon
12/13/2018, 4:21 PMid
matches friendId
to the friends
field.kuldar
12/13/2018, 4:21 PMid !== userId
Maybe this helps?
https://github.com/ounaturg/ounaturg-server/blob/master/src/resolvers/Listing.js#L149-L171Daniel Mahon
12/13/2018, 4:25 PMfriendId === userId
Hyo
12/13/2018, 4:33 PMHyo
12/13/2018, 4:34 PMkuldar
12/13/2018, 4:36 PMid_not: …
instead of NOT: { id: … }
but I need to check that real quickkuldar
12/13/2018, 4:39 PMHyo
12/13/2018, 4:39 PM