serum
12/30/2018, 10:46 AMfilterUser
, that given the name of a friend, say alice, returns all users that are friends with alice.
to achieve this, I need to be able to filter users based on the name of the friends-relation, but afaics the prisma client currently (?) doesn't allow this.
do I need to implement the filter in the resolver myself, or am I missing something here?Harshit
12/30/2018, 4:13 PMserum
12/30/2018, 4:34 PMtype User {
id: ID! @unique
name: String!
friends: [User!]!
}
serum
12/30/2018, 4:37 PMtype Query {
usersFriendsWith(name: String!): [User!]!
}
such that given a name, I get every user, that's friends with that userserum
12/30/2018, 4:37 PMname
should be @unique
in this example too, I guessserum
12/30/2018, 4:39 PMHarshit
12/30/2018, 4:40 PMUniqueInput
serum
12/30/2018, 4:42 PMserum
12/30/2018, 4:47 PMtype Bla {
foos: [Foo!]!
}
type Foo {
text: String!
}
type Query {
findBlasWithFooTextContaining(search: String!): [Bla!]!
}
serum
12/30/2018, 4:49 PMparentBla
to Foo
, so that I can first filter foos()
, and then somehow map parentBla
over the result?