UNPKG

graphql-map-selections

Version:

A package to map selections from graphql resolver info object

14 lines 530 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const toPrismaSelect = (mappedSelection, defaultSelect = false) => { if (!mappedSelection) return defaultSelect; const prismaSelect = mappedSelection; Object.keys(mappedSelection).forEach((s) => { if (typeof prismaSelect[s] === "object") prismaSelect[s] = toPrismaSelect(prismaSelect[s]); }); return { select: prismaSelect }; }; exports.default = toPrismaSelect; //# sourceMappingURL=toPrismaSelect.js.map