🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

json-to-graphql-query

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-to-graphql-query - npm Package Compare versions

Comparing version

to
1.0.0

14

lib/jsonToGraphQLQuery.js

@@ -27,10 +27,18 @@ "use strict";

if (typeof node[key] == 'object') {
var fieldCount = Object.keys(node[key]).length;
var token = void 0;
var subFields = void 0;
if (typeof node[key].__args == 'object') {
output.push([key + " (" + buildArgs(node[key].__args) + ") {", level]);
token = key + " (" + buildArgs(node[key].__args) + ")";
subFields = fieldCount > 1;
}
else {
output.push([key + " {", level]);
token = "" + key;
subFields = fieldCount > 0;
}
output.push([token + (subFields ? ' {' : ''), level]);
convertQuery(node[key], level + 1, output);
output.push(['}', level]);
if (subFields) {
output.push(['}', level]);
}
}

@@ -37,0 +45,0 @@ else {

{
"name": "json-to-graphql-query",
"version": "0.2.0",
"version": "1.0.0",
"main": "lib/index.js",

@@ -9,2 +9,3 @@ "license": "MIT",

"test": "mocha -r ts-node/register --recursive \"./src/**/__tests__/*\"",
"test-watch": "mocha -r ts-node/register --recursive \"./src/**/__tests__/*\" --watch --watch-extensions ts,tsx",
"prepublish": "npm run build && npm run test"

@@ -11,0 +12,0 @@ },

Sorry, the diff of this file is not supported yet