New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@coex/graphql-vercajk

Package Overview
Dependencies
Maintainers
0
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coex/graphql-vercajk - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

23

helpers/parser.js

@@ -8,15 +8,14 @@ import { parse, visit } from "graphql";

const inputName = node.name.value;
if (!node)
if (!node || !node.fields)
return {};
if (!node.fields)
return {};
node.fields.forEach((field, i) => {
node.fields.forEach((field, index) => {
const fieldName = field.name.value;
const isRequired = field.type.kind === "NonNullType";
const childInputName = getNamedInputType(field);
let children = childInputName ? fieldInfo[childInputName] : null;
const children = childInputName ? fieldInfo[childInputName] : null;
const directive = field.directives?.find(d => d.name.value === config.directiveName);
const constraints = extractDirectiveFields(directive);
if (!fieldInfo[inputName])
if (!fieldInfo[inputName]) {
fieldInfo[inputName] = {};
}
fieldInfo[inputName][fieldName] = {

@@ -26,3 +25,3 @@ constraints,

required: isRequired,
order: i,
order: index,
};

@@ -37,10 +36,10 @@ });

directive?.arguments?.forEach(arg => {
let val = null;
let value = null;
if (arg.value.kind === 'StringValue' || arg.value.kind === 'BooleanValue' || arg.value.kind === 'EnumValue') {
val = arg.value.value;
value = arg.value.value;
}
if (arg.value.kind === 'FloatValue' || arg.value.kind === 'IntValue') {
val = parseFloat(arg.value.value);
else if (arg.value.kind === 'FloatValue' || arg.value.kind === 'IntValue') {
value = parseFloat(arg.value.value);
}
constraints[arg.name.value] = val;
constraints[arg.name.value] = value;
});

@@ -47,0 +46,0 @@ return Object.keys(constraints).length !== 0 ? constraints : null;

{
"name": "@coex/graphql-vercajk",
"version": "0.1.3",
"version": "0.1.4",
"description": "Collection of graphql tools",

@@ -5,0 +5,0 @@ "bin": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc