UNPKG

jok

Version:

Bundle of utility functions for code generation related to nodejs and graphql

14 lines (13 loc) 491 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var getGraphqlTypeString_1 = require("./getGraphqlTypeString"); function buildVariablesDeclarationString(inputs) { if (!inputs.length) { return ''; } var argsList = inputs .map(function (x) { return "$" + x.name + ": " + (0, getGraphqlTypeString_1.default)({ type: x.type }); }) .join(', '); return "(" + argsList + ")"; } exports.default = buildVariablesDeclarationString;