Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@graphql-tools/delegate

Package Overview
Dependencies
Maintainers
3
Versions
1642
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.1.0 to 10.1.1-rc-20241101134600-0ce66f428986ab770b2156444438b64a19bf090c

11

cjs/extractUnavailableFields.js

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

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