Jim
05/15/2018, 5:04 AMquery {
groups {
id
name
users(where:{
location: {
id: "cjh5xorfq000c0824kmvjjd63"
}
}) {
id
}
}
}
But I dont know how to pass the location filter to the users relation in my resolver:
groups(parent, args, ctx, info) {
const {location} = args;
return ctx.db.query.groups({}, info);
},
Tatsuyuki Ishi
05/15/2018, 5:12 AMrequest
method with the full query.Corjen
05/15/2018, 6:39 AMreturn ctx.db.query.groups({ where: { location: { id: "id-string" } } }, info)
Tatsuyuki Ishi
05/15/2018, 7:05 AMCorjen
05/15/2018, 7:48 AMctx.db.query.groups({where: { id: "group-id" }})
Jim
05/15/2018, 7:55 AMCorjen
05/15/2018, 8:00 AMCorjen
05/15/2018, 8:03 AMreturn ctx.db.query.groups({ where: {} }, `{
id
name
users(where:{
location: {
id: ${location}
}
}) {
id
}
}`)
Jim
05/15/2018, 8:17 AMreturn ctx.db.query.groups(
{},
`
{
id
name
users(
where: {
location: {
id: "${location}"
}
}
) {
id
}
}
`,
);
Corjen
05/15/2018, 8:20 AM