Mukul
11/30/2018, 1:58 PMAsjas
11/30/2018, 2:06 PMinfo
contains the query that you are sending.Mukul
11/30/2018, 2:09 PMccruz
11/30/2018, 2:09 PMprisma.query.user({ id }, info)
ccruz
11/30/2018, 2:09 PMinfo
is the 4th parameter of the resolver.Mukul
11/30/2018, 2:11 PMMukul
11/30/2018, 2:11 PMasync suggestedRestaurants(parent, args, ctx: Context, info) {
const { where: _where, ...restArgs } = args;
const _id0 = getUserId(ctx);
const user = await ctx.db.query.user({ where: { id: _id0 } });
console.log('user.......', user.follows);
const follows = user.follows || [];
return ctx.db.query.restaurants({
where: {
id_not_in: follows.map((_a) => _a.id),
..._where
},
...restArgs
});
}
Mukul
11/30/2018, 2:11 PMMukul
11/30/2018, 2:16 PMMukul
11/30/2018, 9:33 PMMukul
11/30/2018, 9:33 PM{ id name }
)Mukul
11/30/2018, 9:33 PM