UNPKG

jok

Version:

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

11 lines (10 loc) 757 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function default_1(_a) { var hasFragment = _a.hasFragment, queryName = _a.queryName, variablesDeclarationString = _a.variablesDeclarationString, variablesString = _a.variablesString; if (!hasFragment) { return "\t// build query\n\t\tconst mutation = gql2`\n\t\tmutation " + queryName + variablesDeclarationString + " {\n\t\t\t" + queryName + variablesString + "\n\t\t}\n\t\t`"; } return "\n\t\t// build query\n\t\tconst mutation = gql2`\n\t\tmutation " + queryName + variablesDeclarationString + " {\n\t\t\t" + queryName + variablesString + " {\n\t\t\t\t...${fragmentName}\n\t\t\t}\n\t\t}\n\n\t\t${finishedFragment}\n\t\t`"; } exports.default = default_1;