Socket
Socket
Sign inDemoInstall

@graphql-tools/utils

Package Overview
Dependencies
Maintainers
3
Versions
1273
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-tools/utils - npm Package Compare versions

Comparing version 10.5.0 to 10.5.1-rc-20240812111748-78798d8459089d8d926b87fe0610730d901f4103

50

cjs/print-schema-with-directives.js

@@ -355,36 +355,24 @@ "use strict";

const directiveArguments = [];
if (directive != null) {
for (const arg of directive.args) {
const argName = arg.name;
const argValue = args?.[argName];
if (argValue !== undefined) {
const value = (0, astFromValue_js_1.astFromValue)(argValue, arg.type);
if (value) {
directiveArguments.push({
kind: graphql_1.Kind.ARGUMENT,
name: {
kind: graphql_1.Kind.NAME,
value: argName,
},
value,
});
}
for (const argName in args) {
const argValue = args[argName];
let value;
if (directive != null) {
const arg = directive.args.find(arg => arg.name === argName);
if (arg) {
value = (0, astFromValue_js_1.astFromValue)(argValue, arg.type);
}
}
}
else {
for (const argName in args) {
const argValue = args[argName];
const value = (0, astFromValueUntyped_js_1.astFromValueUntyped)(argValue);
if (value) {
directiveArguments.push({
kind: graphql_1.Kind.ARGUMENT,
name: {
kind: graphql_1.Kind.NAME,
value: argName,
},
value,
});
}
if (value == null) {
value = (0, astFromValueUntyped_js_1.astFromValueUntyped)(argValue);
}
if (value != null) {
directiveArguments.push({
kind: graphql_1.Kind.ARGUMENT,
name: {
kind: graphql_1.Kind.NAME,
value: argName,
},
value,
});
}
}

@@ -391,0 +379,0 @@ return {

@@ -335,36 +335,24 @@ import { GraphQLDeprecatedDirective, isEnumType, isInputObjectType, isInterfaceType, isIntrospectionType, isObjectType, isScalarType, isSpecifiedDirective, isSpecifiedScalarType, isUnionType, Kind, print, } from 'graphql';

const directiveArguments = [];
if (directive != null) {
for (const arg of directive.args) {
const argName = arg.name;
const argValue = args?.[argName];
if (argValue !== undefined) {
const value = astFromValue(argValue, arg.type);
if (value) {
directiveArguments.push({
kind: Kind.ARGUMENT,
name: {
kind: Kind.NAME,
value: argName,
},
value,
});
}
for (const argName in args) {
const argValue = args[argName];
let value;
if (directive != null) {
const arg = directive.args.find(arg => arg.name === argName);
if (arg) {
value = astFromValue(argValue, arg.type);
}
}
}
else {
for (const argName in args) {
const argValue = args[argName];
const value = astFromValueUntyped(argValue);
if (value) {
directiveArguments.push({
kind: Kind.ARGUMENT,
name: {
kind: Kind.NAME,
value: argName,
},
value,
});
}
if (value == null) {
value = astFromValueUntyped(argValue);
}
if (value != null) {
directiveArguments.push({
kind: Kind.ARGUMENT,
name: {
kind: Kind.NAME,
value: argName,
},
value,
});
}
}

@@ -371,0 +359,0 @@ return {

{
"name": "@graphql-tools/utils",
"version": "10.5.0",
"version": "10.5.1-rc-20240812111748-78798d8459089d8d926b87fe0610730d901f4103",
"description": "Common package containing utils and types for GraphQL tools",

@@ -5,0 +5,0 @@ "sideEffects": false,

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