@graphql-tools/delegate
Advanced tools
Comparing version 10.0.21-alpha-20240826091035-7153ab38380f18449e47bf2c052366505a0e7544 to 10.0.21-alpha-20240826095136-79d09dca0736685310001edc9bed43d3ea8df435
@@ -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) { |
{ | ||
"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, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
243115
4768