@graphql-tools/delegate
Advanced tools
Comparing version 10.1.0 to 10.1.1-rc-20241101134600-0ce66f428986ab770b2156444438b64a19bf090c
@@ -54,6 +54,6 @@ "use strict"; | ||
else if (selection.kind === graphql_1.Kind.INLINE_FRAGMENT) { | ||
const subFieldType = selection.typeCondition | ||
? schema.getType(selection.typeCondition.name.value) | ||
: fieldType; | ||
if (subFieldType === fieldType || | ||
const subFieldName = selection.typeCondition?.name.value || fieldType.name; | ||
const subFieldType = (selection.typeCondition && schema.getType(subFieldName)) || | ||
fieldType; | ||
if (subFieldName === fieldType.name || | ||
(((0, graphql_1.isObjectType)(subFieldType) || (0, graphql_1.isInterfaceType)(subFieldType)) && | ||
@@ -75,2 +75,5 @@ (0, graphql_1.isAbstractType)(fieldType) && | ||
for (const subSelection of selection.selectionSet.selections) { | ||
if (subSelection.kind === graphql_1.Kind.FIELD && subSelection.name.value === '__typename') { | ||
continue; | ||
} | ||
if (shouldAdd(subFieldType, subSelection)) { | ||
@@ -77,0 +80,0 @@ unavailableSelections.push(subSelection); |
@@ -51,6 +51,6 @@ import { getNamedType, isAbstractType, isInterfaceType, isLeafType, isObjectType, isUnionType, Kind, visit, } from 'graphql'; | ||
else if (selection.kind === Kind.INLINE_FRAGMENT) { | ||
const subFieldType = selection.typeCondition | ||
? schema.getType(selection.typeCondition.name.value) | ||
: fieldType; | ||
if (subFieldType === fieldType || | ||
const subFieldName = selection.typeCondition?.name.value || fieldType.name; | ||
const subFieldType = (selection.typeCondition && schema.getType(subFieldName)) || | ||
fieldType; | ||
if (subFieldName === fieldType.name || | ||
((isObjectType(subFieldType) || isInterfaceType(subFieldType)) && | ||
@@ -72,2 +72,5 @@ isAbstractType(fieldType) && | ||
for (const subSelection of selection.selectionSet.selections) { | ||
if (subSelection.kind === Kind.FIELD && subSelection.name.value === '__typename') { | ||
continue; | ||
} | ||
if (shouldAdd(subFieldType, subSelection)) { | ||
@@ -74,0 +77,0 @@ unavailableSelections.push(subSelection); |
{ | ||
"name": "@graphql-tools/delegate", | ||
"version": "10.1.0", | ||
"version": "10.1.1-rc-20241101134600-0ce66f428986ab770b2156444438b64a19bf090c", | ||
"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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
244005
4773
2