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

@graphql-toolkit/schema-merging

Package Overview
Dependencies
Maintainers
3
Versions
704
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-toolkit/schema-merging - npm Package Compare versions

Comparing version 0.6.8-alpha-0aec269.1 to 0.6.8-alpha-0fa63c6.8

21

dist/commonjs/typedefs-mergers/enum-values.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function alreadyExists(arr, other) {
return !!arr.find(v => v.name.value === other.name.value);
}
const _1 = require(".");
function mergeEnumValues(first, second) {
return [...second, ...first.filter(d => !alreadyExists(second, d))];
const enumValueMap = new Map();
for (const firstValue of first) {
enumValueMap.set(firstValue.name.value, firstValue);
}
for (const secondValue of second) {
const enumValue = secondValue.name.value;
if (enumValueMap.has(enumValue)) {
const firstValue = enumValueMap.get(enumValue);
firstValue.description = secondValue.description || firstValue.description;
firstValue.directives = _1.mergeDirectives(secondValue.directives, firstValue.directives);
}
else {
enumValueMap.set(enumValue, secondValue);
}
}
return [...enumValueMap.values()];
}
exports.mergeEnumValues = mergeEnumValues;
//# sourceMappingURL=enum-values.js.map

@@ -34,2 +34,3 @@ "use strict";

existing['directives'] = directives_1.mergeDirectives(field['directives'], existing['directives'], config);
existing['description'] = field['description'] || existing['description'];
}

@@ -36,0 +37,0 @@ else {

@@ -1,7 +0,20 @@

function alreadyExists(arr, other) {
return !!arr.find(v => v.name.value === other.name.value);
}
import { mergeDirectives } from '.';
export function mergeEnumValues(first, second) {
return [...second, ...first.filter(d => !alreadyExists(second, d))];
const enumValueMap = new Map();
for (const firstValue of first) {
enumValueMap.set(firstValue.name.value, firstValue);
}
for (const secondValue of second) {
const enumValue = secondValue.name.value;
if (enumValueMap.has(enumValue)) {
const firstValue = enumValueMap.get(enumValue);
firstValue.description = secondValue.description || firstValue.description;
firstValue.directives = mergeDirectives(secondValue.directives, firstValue.directives);
}
else {
enumValueMap.set(enumValue, secondValue);
}
}
return [...enumValueMap.values()];
}
//# sourceMappingURL=enum-values.js.map

@@ -32,2 +32,3 @@ import { extractType, isWrappingTypeNode, isListTypeNode, isNonNullTypeNode, printTypeNode } from './utils';

existing['directives'] = mergeDirectives(field['directives'], existing['directives'], config);
existing['description'] = field['description'] || existing['description'];
}

@@ -34,0 +35,0 @@ else {

11

package.json
{
"name": "@graphql-toolkit/schema-merging",
"version": "0.6.8-alpha-0aec269.1+0aec269",
"version": "0.6.8-alpha-0fa63c6.8+0fa63c6",
"description": "A set of utils for faster development of GraphQL tools",

@@ -25,3 +25,3 @@ "repository": "git@github.com:dotansimha/graphql-toolkit.git",

"@types/deepmerge": "2.2.0",
"@types/jest": "24.0.21",
"@types/jest": "24.0.22",
"graphql": "14.5.8",

@@ -33,5 +33,6 @@ "jest": "24.9.0",

"dependencies": {
"@graphql-toolkit/common": "0.6.8-alpha-0aec269.1+0aec269",
"@graphql-toolkit/common": "0.6.8-alpha-0fa63c6.8+0fa63c6",
"@kamilkisiela/graphql-tools": "4.0.6",
"deepmerge": "4.2.2"
"deepmerge": "4.2.2",
"tslib": "1.10.0"
},

@@ -41,3 +42,3 @@ "publishConfig": {

},
"gitHead": "0aec269a77e1dd82cfaa778f92766ec79f019717"
"gitHead": "0fa63c6dfa82e8aaab5850752a44a2883f3b3379"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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