1.0.2 • Published 4 years ago

gql-info-to-select v1.0.2

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

gql-info-to-select

David GitHub code size in bytes GitHub repo size npm npm npm npm NPM npm GitHub last commit npm collaborators

This module takes graphQL info object and returns prisma-clint's include object

Installation

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,
});