Socket
Socket
Sign inDemoInstall

@graphql-tools/utils

Package Overview
Dependencies
5
Maintainers
0
Versions
1211
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 10.2.2 to 10.2.3-alpha-20240701104621-6e67f50844f7f4cbd61964900403a66232ead248

32

cjs/visitResult.js

@@ -180,7 +180,35 @@ "use strict";

const finalType = schema.getType(value.__typename);
const { fields: collectedFields } = (0, collectFields_js_1.collectSubFields)(schema, fragments, variableValues, finalType, fieldNodes);
let { fields: collectedFields, patches } = (0, collectFields_js_1.collectSubFields)(schema, fragments, variableValues, finalType, fieldNodes);
if (patches.length) {
collectedFields = new Map(collectedFields);
for (const patch of patches) {
for (const [responseKey, fields] of patch.fields) {
const existingFields = collectedFields.get(responseKey);
if (existingFields) {
existingFields.push(...fields);
}
else {
collectedFields.set(responseKey, fields);
}
}
}
}
return visitObjectValue(value, finalType, collectedFields, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo);
}
else if ((0, graphql_1.isObjectType)(nullableType)) {
const { fields: collectedFields } = (0, collectFields_js_1.collectSubFields)(schema, fragments, variableValues, nullableType, fieldNodes);
let { fields: collectedFields, patches } = (0, collectFields_js_1.collectSubFields)(schema, fragments, variableValues, nullableType, fieldNodes);
if (patches.length) {
collectedFields = new Map(collectedFields);
for (const patch of patches) {
for (const [responseKey, fields] of patch.fields) {
const existingFields = collectedFields.get(responseKey);
if (existingFields) {
existingFields.push(...fields);
}
else {
collectedFields.set(responseKey, fields);
}
}
}
}
return visitObjectValue(value, nullableType, collectedFields, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo);

@@ -187,0 +215,0 @@ }

@@ -174,7 +174,35 @@ import { getNullableType, isAbstractType, isListType, isObjectType, Kind, SchemaMetaFieldDef, TypeMetaFieldDef, TypeNameMetaFieldDef, } from 'graphql';

const finalType = schema.getType(value.__typename);
const { fields: collectedFields } = collectSubFields(schema, fragments, variableValues, finalType, fieldNodes);
let { fields: collectedFields, patches } = collectSubFields(schema, fragments, variableValues, finalType, fieldNodes);
if (patches.length) {
collectedFields = new Map(collectedFields);
for (const patch of patches) {
for (const [responseKey, fields] of patch.fields) {
const existingFields = collectedFields.get(responseKey);
if (existingFields) {
existingFields.push(...fields);
}
else {
collectedFields.set(responseKey, fields);
}
}
}
}
return visitObjectValue(value, finalType, collectedFields, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo);
}
else if (isObjectType(nullableType)) {
const { fields: collectedFields } = collectSubFields(schema, fragments, variableValues, nullableType, fieldNodes);
let { fields: collectedFields, patches } = collectSubFields(schema, fragments, variableValues, nullableType, fieldNodes);
if (patches.length) {
collectedFields = new Map(collectedFields);
for (const patch of patches) {
for (const [responseKey, fields] of patch.fields) {
const existingFields = collectedFields.get(responseKey);
if (existingFields) {
existingFields.push(...fields);
}
else {
collectedFields.set(responseKey, fields);
}
}
}
}
return visitObjectValue(value, nullableType, collectedFields, schema, fragments, variableValues, resultVisitorMap, pathIndex, errors, errorInfo);

@@ -181,0 +209,0 @@ }

2

package.json
{
"name": "@graphql-tools/utils",
"version": "10.2.2",
"version": "10.2.3-alpha-20240701104621-6e67f50844f7f4cbd61964900403a66232ead248",
"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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc