Socket
Socket
Sign inDemoInstall

@graphql-tools/delegate

Package Overview
Dependencies
Maintainers
3
Versions
1495
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-tools/delegate - npm Package Compare versions

Comparing version 10.0.21-alpha-20240826091035-7153ab38380f18449e47bf2c052366505a0e7544 to 10.0.21-alpha-20240826095136-79d09dca0736685310001edc9bed43d3ea8df435

16

cjs/defaultMergedResolver.js

@@ -44,3 +44,14 @@ "use strict";

missingDeferredFields.set(responseKey, deferred);
handleResult(parent, responseKey, context, info);
const stitchingInfo = info.schema.extensions?.['stitchingInfo'];
const parentTypeName = parent?.__typename || info.parentType.name;
const fieldNodesByType = stitchingInfo?.fieldNodesByField?.[parentTypeName]?.[info.fieldName];
if (fieldNodesByType.every(fieldNode => {
const responseKey = fieldNode.alias?.value ?? fieldNode.name.value;
if (Object.prototype.hasOwnProperty.call(parent, responseKey)) {
return true;
}
return false;
})) {
handleResult(parent, responseKey, context, info);
}
return deferred.promise;

@@ -146,4 +157,3 @@ }

const nestedSelectionSet = selectionNode.selectionSet;
if (info.operation.selectionSet.selections.some(selection => selection.kind === graphql_1.Kind.FIELD && selection.name.value !== responseKey) &&
nestedParent != null) {
if (nestedParent != null) {
if (!parentSatisfiedSelectionSet(nestedParent, nestedSelectionSet)) {

@@ -150,0 +160,0 @@ async function handleNestedParentItem(nestedParentItem, fieldNode) {

@@ -41,3 +41,14 @@ import { defaultFieldResolver, Kind, responsePathAsArray, } from 'graphql';

missingDeferredFields.set(responseKey, deferred);
handleResult(parent, responseKey, context, info);
const stitchingInfo = info.schema.extensions?.['stitchingInfo'];
const parentTypeName = parent?.__typename || info.parentType.name;
const fieldNodesByType = stitchingInfo?.fieldNodesByField?.[parentTypeName]?.[info.fieldName];
if (fieldNodesByType.every(fieldNode => {
const responseKey = fieldNode.alias?.value ?? fieldNode.name.value;
if (Object.prototype.hasOwnProperty.call(parent, responseKey)) {
return true;
}
return false;
})) {
handleResult(parent, responseKey, context, info);
}
return deferred.promise;

@@ -142,4 +153,3 @@ }

const nestedSelectionSet = selectionNode.selectionSet;
if (info.operation.selectionSet.selections.some(selection => selection.kind === Kind.FIELD && selection.name.value !== responseKey) &&
nestedParent != null) {
if (nestedParent != null) {
if (!parentSatisfiedSelectionSet(nestedParent, nestedSelectionSet)) {

@@ -146,0 +156,0 @@ async function handleNestedParentItem(nestedParentItem, fieldNode) {

2

package.json
{
"name": "@graphql-tools/delegate",
"version": "10.0.21-alpha-20240826091035-7153ab38380f18449e47bf2c052366505a0e7544",
"version": "10.0.21-alpha-20240826095136-79d09dca0736685310001edc9bed43d3ea8df435",
"description": "A set of utils for faster development of 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