This module takes graphQL info object and returns prisma-clint's include object
Using npm:
$ npm i gql-info-to-select
Note: add --save
if you are using npm < 5.0.0
In Node.js:
// Load the full build.
var infoSelect = require("gql-info-to-select");
var userIncludes = infoSelect.includes(info);
return ctx.prisma.user.findOne({
where: { id: ctx.user.id },
include: userIncludes,
});
// Load the full build.
var infoSelect = require("gql-info-to-select");
var userIncludes = infoSelect.includes(info);
return ctx.prisma.user.findOne({
where: { id: ctx.user.id },
include: userIncludes,
});