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

@graphql-tools/resolvers-composition

Package Overview
Dependencies
Maintainers
3
Versions
1018
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-tools/resolvers-composition - npm Package Compare versions

Comparing version 5.0.1-alpha-ac91d12.0 to 5.0.1-alpha-af24cb2.0

chain-functions.d.ts

8

index.cjs.js

@@ -16,4 +16,2 @@ 'use strict';

const flattenArray = (arr) => arr.reduce((acc, next) => acc.concat(Array.isArray(next) ? flattenArray(next) : next), []);
function resolveRelevantMappings(resolvers, path, allMappings) {

@@ -28,6 +26,6 @@ const splitted = path.split('.');

if (typeName === '*') {
return flattenArray(Object.keys(resolvers).map(typeName => resolveRelevantMappings(resolvers, `${typeName}.${fieldName}`, allMappings)));
return lodash.flatten(Object.keys(resolvers).map(typeName => resolveRelevantMappings(resolvers, `${typeName}.${fieldName}`, allMappings)));
}
if (fieldName === '*') {
return flattenArray(Object.keys(resolvers[typeName]).map(field => resolveRelevantMappings(resolvers, `${typeName}.${field}`, allMappings))).filter(mapItem => !allMappings[mapItem]);
return lodash.flatten(Object.keys(resolvers[typeName]).map(field => resolveRelevantMappings(resolvers, `${typeName}.${field}`, allMappings))).filter(mapItem => !allMappings[mapItem]);
}

@@ -52,3 +50,3 @@ else {

const typeName = splitted[0];
return flattenArray(Object.keys(resolvers[typeName]).map(fieldName => resolveRelevantMappings(resolvers, `${typeName}.${fieldName}`, allMappings)));
return lodash.flatten(Object.keys(resolvers[typeName]).map(fieldName => resolveRelevantMappings(resolvers, `${typeName}.${fieldName}`, allMappings)));
}

@@ -55,0 +53,0 @@ return [];

@@ -1,2 +0,2 @@

import { get, set } from 'lodash';
import { get, set, flatten } from 'lodash';
import { isScalarType } from 'graphql';

@@ -12,4 +12,2 @@ import { asArray } from '@graphql-tools/utils';

const flattenArray = (arr) => arr.reduce((acc, next) => acc.concat(Array.isArray(next) ? flattenArray(next) : next), []);
function resolveRelevantMappings(resolvers, path, allMappings) {

@@ -24,6 +22,6 @@ const splitted = path.split('.');

if (typeName === '*') {
return flattenArray(Object.keys(resolvers).map(typeName => resolveRelevantMappings(resolvers, `${typeName}.${fieldName}`, allMappings)));
return flatten(Object.keys(resolvers).map(typeName => resolveRelevantMappings(resolvers, `${typeName}.${fieldName}`, allMappings)));
}
if (fieldName === '*') {
return flattenArray(Object.keys(resolvers[typeName]).map(field => resolveRelevantMappings(resolvers, `${typeName}.${field}`, allMappings))).filter(mapItem => !allMappings[mapItem]);
return flatten(Object.keys(resolvers[typeName]).map(field => resolveRelevantMappings(resolvers, `${typeName}.${field}`, allMappings))).filter(mapItem => !allMappings[mapItem]);
}

@@ -48,3 +46,3 @@ else {

const typeName = splitted[0];
return flattenArray(Object.keys(resolvers[typeName]).map(fieldName => resolveRelevantMappings(resolvers, `${typeName}.${fieldName}`, allMappings)));
return flatten(Object.keys(resolvers[typeName]).map(fieldName => resolveRelevantMappings(resolvers, `${typeName}.${fieldName}`, allMappings)));
}

@@ -51,0 +49,0 @@ return [];

{
"name": "@graphql-tools/resolvers-composition",
"version": "5.0.1-alpha-ac91d12.0",
"version": "5.0.1-alpha-af24cb2.0",
"description": "Common package containting utils and types for GraphQL tools",

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

"dependencies": {
"@graphql-tools/utils": "5.0.1-alpha-ac91d12.0",
"@graphql-tools/utils": "5.0.1-alpha-af24cb2.0",
"lodash": "4.17.15"

@@ -23,3 +23,4 @@ },

"devDependencies": {
"@types/lodash": "4.14.150"
"@types/lodash": "4.14.150",
"iterall": "1.3.0"
},

@@ -26,0 +27,0 @@ "publishConfig": {

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