Skip to content

Converts graphQL info parameter into Prisma-client select part

License

Notifications You must be signed in to change notification settings

noshadil/gql-info-to-select

Repository files navigation

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

About

Converts graphQL info parameter into Prisma-client select part

Resources

License

Stars

Watchers

Forks

Packages

No packages published