Socket
Socket
Sign inDemoInstall

@graphql-tools/utils

Package Overview
Dependencies
6
Maintainers
3
Versions
1211
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 10.3.0-alpha-20240702150657-b50b1dda80c0083a63896cdbfd42efdcdf4c0b98 to 10.3.0-alpha-20240702193427-1ce4b1efdef732d2635b657df6273a975a19d217

cjs/createDeferred.js

1

cjs/index.js

@@ -62,1 +62,2 @@ "use strict";

tslib_1.__exportStar(require("./debugTimer.js"), exports);
tslib_1.__exportStar(require("./createDeferred.js"), exports);

@@ -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 @@ }

@@ -57,1 +57,2 @@ export * from './loaders.js';

export * from './debugTimer.js';
export * from './createDeferred.js';

@@ -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.3.0-alpha-20240702150657-b50b1dda80c0083a63896cdbfd42efdcdf4c0b98",
"version": "10.3.0-alpha-20240702193427-1ce4b1efdef732d2635b657df6273a975a19d217",
"description": "Common package containing utils and types for GraphQL tools",

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

@@ -57,1 +57,2 @@ export * from './loaders.js';

export * from './debugTimer.js';
export * from './createDeferred.js';

Sorry, the diff of this file is not supported yet

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