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
1527
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 6.0.0-alpha-b3f9b0a.0 to 6.0.0-alpha-bbd6275.0

21

index.cjs.js

@@ -781,9 +781,11 @@ 'use strict';

function handleObject(type, object, errors, subschema, context, info, skipTypeMerging) {
var _a;
const stitchingInfo = (_a = info === null || info === void 0 ? void 0 : info.schema.extensions) === null || _a === void 0 ? void 0 : _a.stitchingInfo;
utils.setErrors(object, errors.map(error => utils.slicedError(error)));
setObjectSubschema(object, subschema);
if (skipTypeMerging || !(info === null || info === void 0 ? void 0 : info.mergeInfo)) {
if (skipTypeMerging || !stitchingInfo) {
return object;
}
const typeName = graphql.isAbstractType(type) ? info.schema.getTypeMap()[object.__typename].name : type.name;
const mergedTypeInfo = info.mergeInfo.mergedTypes[typeName];
const mergedTypeInfo = stitchingInfo.mergedTypes[typeName];
let targetSubschemas;

@@ -1114,11 +1116,12 @@ if (mergedTypeInfo != null) {

function buildDelegationTransforms(subschemaOrSubschemaConfig, info, context, targetSchema, fieldName, args, returnType, transforms, transformedSchema, skipTypeMerging) {
var _a;
var _a, _b;
const stitchingInfo = (_a = info === null || info === void 0 ? void 0 : info.schema.extensions) === null || _a === void 0 ? void 0 : _a.stitchingInfo;
let delegationTransforms = [
new CheckResultAndHandleErrors(info, fieldName, subschemaOrSubschemaConfig, context, returnType, skipTypeMerging),
];
if ((info === null || info === void 0 ? void 0 : info.mergeInfo) != null) {
delegationTransforms.push(new AddReplacementSelectionSets(info.schema, info.mergeInfo.replacementSelectionSets), new AddMergedTypeFragments(info.schema, info.mergeInfo.mergedTypes));
if (stitchingInfo != null) {
delegationTransforms.push(new AddReplacementSelectionSets(info.schema, stitchingInfo.replacementSelectionSets), new AddMergedTypeFragments(info.schema, stitchingInfo.mergedTypes));
}
const transformedTargetSchema = (info === null || info === void 0 ? void 0 : info.mergeInfo) == null
? transformedSchema !== null && transformedSchema !== void 0 ? transformedSchema : targetSchema : (_a = transformedSchema !== null && transformedSchema !== void 0 ? transformedSchema : info.mergeInfo.transformedSchemas.get(subschemaOrSubschemaConfig)) !== null && _a !== void 0 ? _a : targetSchema;
const transformedTargetSchema = stitchingInfo == null
? transformedSchema !== null && transformedSchema !== void 0 ? transformedSchema : targetSchema : (_b = transformedSchema !== null && transformedSchema !== void 0 ? transformedSchema : stitchingInfo.transformedSchemas.get(subschemaOrSubschemaConfig)) !== null && _b !== void 0 ? _b : targetSchema;
delegationTransforms.push(new WrapConcreteTypes(returnType, transformedTargetSchema));

@@ -1129,4 +1132,4 @@ if (info != null) {

delegationTransforms = delegationTransforms.concat(transforms);
if ((info === null || info === void 0 ? void 0 : info.mergeInfo) != null) {
delegationTransforms.push(new AddReplacementFragments(targetSchema, info.mergeInfo.replacementFragments));
if (stitchingInfo != null) {
delegationTransforms.push(new AddReplacementFragments(targetSchema, stitchingInfo.replacementFragments));
}

@@ -1133,0 +1136,0 @@ if (args != null) {

@@ -777,9 +777,11 @@ import { visit, visitWithTypeInfo, Kind, getNamedType, isAbstractType, TypeInfo, isObjectType, isInterfaceType, TypeNameMetaFieldDef, getNullableType, isLeafType, isCompositeType, isListType, typeFromAST, isSchema, getOperationAST, validate, execute, subscribe, defaultFieldResolver, parse } from 'graphql';

function handleObject(type, object, errors, subschema, context, info, skipTypeMerging) {
var _a;
const stitchingInfo = (_a = info === null || info === void 0 ? void 0 : info.schema.extensions) === null || _a === void 0 ? void 0 : _a.stitchingInfo;
setErrors(object, errors.map(error => slicedError(error)));
setObjectSubschema(object, subschema);
if (skipTypeMerging || !(info === null || info === void 0 ? void 0 : info.mergeInfo)) {
if (skipTypeMerging || !stitchingInfo) {
return object;
}
const typeName = isAbstractType(type) ? info.schema.getTypeMap()[object.__typename].name : type.name;
const mergedTypeInfo = info.mergeInfo.mergedTypes[typeName];
const mergedTypeInfo = stitchingInfo.mergedTypes[typeName];
let targetSubschemas;

@@ -1110,11 +1112,12 @@ if (mergedTypeInfo != null) {

function buildDelegationTransforms(subschemaOrSubschemaConfig, info, context, targetSchema, fieldName, args, returnType, transforms, transformedSchema, skipTypeMerging) {
var _a;
var _a, _b;
const stitchingInfo = (_a = info === null || info === void 0 ? void 0 : info.schema.extensions) === null || _a === void 0 ? void 0 : _a.stitchingInfo;
let delegationTransforms = [
new CheckResultAndHandleErrors(info, fieldName, subschemaOrSubschemaConfig, context, returnType, skipTypeMerging),
];
if ((info === null || info === void 0 ? void 0 : info.mergeInfo) != null) {
delegationTransforms.push(new AddReplacementSelectionSets(info.schema, info.mergeInfo.replacementSelectionSets), new AddMergedTypeFragments(info.schema, info.mergeInfo.mergedTypes));
if (stitchingInfo != null) {
delegationTransforms.push(new AddReplacementSelectionSets(info.schema, stitchingInfo.replacementSelectionSets), new AddMergedTypeFragments(info.schema, stitchingInfo.mergedTypes));
}
const transformedTargetSchema = (info === null || info === void 0 ? void 0 : info.mergeInfo) == null
? transformedSchema !== null && transformedSchema !== void 0 ? transformedSchema : targetSchema : (_a = transformedSchema !== null && transformedSchema !== void 0 ? transformedSchema : info.mergeInfo.transformedSchemas.get(subschemaOrSubschemaConfig)) !== null && _a !== void 0 ? _a : targetSchema;
const transformedTargetSchema = stitchingInfo == null
? transformedSchema !== null && transformedSchema !== void 0 ? transformedSchema : targetSchema : (_b = transformedSchema !== null && transformedSchema !== void 0 ? transformedSchema : stitchingInfo.transformedSchemas.get(subschemaOrSubschemaConfig)) !== null && _b !== void 0 ? _b : targetSchema;
delegationTransforms.push(new WrapConcreteTypes(returnType, transformedTargetSchema));

@@ -1125,4 +1128,4 @@ if (info != null) {

delegationTransforms = delegationTransforms.concat(transforms);
if ((info === null || info === void 0 ? void 0 : info.mergeInfo) != null) {
delegationTransforms.push(new AddReplacementFragments(targetSchema, info.mergeInfo.replacementFragments));
if (stitchingInfo != null) {
delegationTransforms.push(new AddReplacementFragments(targetSchema, stitchingInfo.replacementFragments));
}

@@ -1129,0 +1132,0 @@ if (args != null) {

{
"name": "@graphql-tools/delegate",
"version": "6.0.0-alpha-b3f9b0a.0",
"version": "6.0.0-alpha-bbd6275.0",
"description": "A set of utils for faster development of GraphQL tools",

@@ -9,5 +9,5 @@ "peerDependencies": {

"dependencies": {
"@graphql-tools/schema": "6.0.0-alpha-b3f9b0a.0",
"@graphql-tools/utils": "6.0.0-alpha-b3f9b0a.0",
"tslib": "1.11.1"
"@graphql-tools/schema": "6.0.0-alpha-bbd6275.0",
"@graphql-tools/utils": "6.0.0-alpha-bbd6275.0",
"tslib": "~2.0.0"
},

@@ -14,0 +14,0 @@ "repository": "git@github.com:ardatan/graphql-tools.git",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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