graphql-js-tree
Advanced tools
Comparing version 0.2.6 to 0.2.7
@@ -102,13 +102,2 @@ "use strict"; | ||
} | ||
if (node.data.type === Models_1.Instances.Argument) { | ||
const parent = allNodes.find((p) => p.directives.some((a) => a.args.includes(node))); | ||
if (parent) { | ||
const parentDirective = parent.directives.find((d) => d.args.some((a) => a === node)); | ||
if (parentDirective) { | ||
const indexInDirective = parentDirective.args.indexOf(node); | ||
deleteFieldFromNode(parentDirective, indexInDirective); | ||
} | ||
} | ||
return; | ||
} | ||
if (node.data.type === Models_1.ValueDefinition.InputValueDefinition) { | ||
@@ -138,2 +127,8 @@ const parent = allNodes.find((parentNode) => parentNode.args.includes(node)); | ||
} | ||
if (node.data.type === Models_1.Instances.Directive) { | ||
throw new Error('Directives should be removed on node directly not using this function'); | ||
} | ||
if (node.data.type === Models_1.Instances.Argument) { | ||
throw new Error('Directive Arguments should be removed on node directly not using this function'); | ||
} | ||
const deletedNode = tree.nodes.findIndex((n) => n === node); | ||
@@ -140,0 +135,0 @@ if (deletedNode === -1) |
{ | ||
"name": "graphql-js-tree", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
92309
1882