@replit/clui-gql
Advanced tools
Comparing version 0.0.6 to 0.0.7
export { default as toCommand } from './toCommand'; | ||
export { default as parseArgs } from './parseArgs'; | ||
export { default as visit } from './visit'; | ||
export { default as forEach } from './forEach'; | ||
export * from './types'; |
@@ -7,4 +7,4 @@ "use strict"; | ||
exports.parseArgs = parseArgs_1.default; | ||
var visit_1 = require("./visit"); | ||
exports.visit = visit_1.default; | ||
var forEach_1 = require("./forEach"); | ||
exports.forEach = forEach_1.default; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@replit/clui-gql", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "A utility to transform GraphQL introspection type into a CLUI command", | ||
@@ -5,0 +5,0 @@ "author": "moudy@repl.it", |
@@ -24,18 +24,2 @@ "use strict"; | ||
}; | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -73,6 +57,6 @@ var parseValue = function (options) { | ||
try { | ||
for (var _b = __values(Object.entries(options.command.args)), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var _d = __read(_c.value, 2), key = _d[0], arg = _d[1]; | ||
var value = options.args[key]; | ||
delete extra[key]; | ||
for (var _b = __values(Object.values(options.command.args)), _c = _b.next(); !_c.done; _c = _b.next()) { | ||
var arg = _c.value; | ||
var value = options.args[arg.name]; | ||
delete extra[arg.name]; | ||
if (value === undefined) { | ||
@@ -79,0 +63,0 @@ if (arg.required) { |
@@ -13,6 +13,6 @@ # CLUI GraphQL | ||
To create a tree of CLUI commands call `toCommand` and then `visit` eash command to defined a run function. | ||
To create a tree of CLUI commands call `toCommand` and then call `forEach` to defined a run function for each command. | ||
```jsx | ||
import { toCommand, visit } from '@replit/clui-gql'; | ||
import { toCommand, forEach } from '@replit/clui-gql'; | ||
import { introspectionFromSchema } from 'graphql'; | ||
@@ -58,3 +58,3 @@ import schema from './your-graphql-schema'; | ||
// Define some application specific behavior for when a command is `run` | ||
visit(root, (command) => { | ||
forEach(root, ({ command }) => { | ||
if (command.outputType !== 'YourOutputTypes') { | ||
@@ -61,0 +61,0 @@ // If command does not match an output type you may want do something differeny. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
32347
506