@graphql-tools/resolvers-composition
Advanced tools
Comparing version 5.0.1-alpha-ac91d12.0 to 5.0.1-alpha-af24cb2.0
@@ -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
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
22928
2
8
185
+ Added@graphql-tools/utils@5.0.1-alpha-af24cb2.0(transitive)
- Removed@graphql-tools/utils@5.0.1-alpha-ac91d12.0(transitive)