Socket
Socket
Sign inDemoInstall

@graphql-toolkit/core

Package Overview
Dependencies
Maintainers
3
Versions
693
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-toolkit/core - npm Package Compare versions

Comparing version 0.10.5-alpha-7705fd0.9 to 0.10.5-alpha-7c19cfe.11

44

index.cjs.js

@@ -1165,12 +1165,3 @@ 'use strict';

});
const schemas = [];
const typeDefs = [];
sources.forEach(source => {
if (source.schema) {
schemas.push(source.schema);
}
else {
typeDefs.push(source.document);
}
});
const { schemas, typeDefs } = collectSchemasAndTypeDefs(sources);
const mergeSchemasOptions = {

@@ -1181,3 +1172,7 @@ schemas,

};
return schemaMerging.mergeSchemasAsync(mergeSchemasOptions);
const schema = await schemaMerging.mergeSchemasAsync(mergeSchemasOptions);
if (options.includeSources) {
includeSources(schema, sources);
}
return schema;
}

@@ -1189,5 +1184,26 @@ function loadSchemaSync(schemaPointers, options) {

});
const { schemas, typeDefs } = collectSchemasAndTypeDefs(sources);
const mergeSchemasOptions = {
schemas,
typeDefs,
...options,
};
const schema = schemaMerging.mergeSchemas(mergeSchemasOptions);
if (options.includeSources) {
includeSources(schema, sources);
}
return schema;
}
function includeSources(schema, sources) {
schema.extensions = {
...schema.extensions,
sources: sources
.filter((source) => source.rawSDL || source.document)
.map((source) => new graphql.Source(source.rawSDL || graphql.print(source.document), source.location)),
};
}
function collectSchemasAndTypeDefs(sources) {
const schemas = [];
const typeDefs = [];
sources.forEach(source => {
sources.forEach((source) => {
if (source.schema) {

@@ -1200,8 +1216,6 @@ schemas.push(source.schema);

});
const mergeSchemasOptions = {
return {
schemas,
typeDefs,
...options,
};
return schemaMerging.mergeSchemas(mergeSchemasOptions);
}

@@ -1208,0 +1222,0 @@

import { asArray, resolveBuiltinModule, resolveBuiltinModuleSync, debugLog, printSchemaWithDirectives, isDocumentString, parseGraphQLSDL, compareNodes, fixSchemaAst, compareStrings } from '@graphql-toolkit/common';
import { isSchema, parse, Kind, Source } from 'graphql';
import { isSchema, parse, Kind, Source, print } from 'graphql';
import isGlob from 'is-glob';

@@ -1140,12 +1140,3 @@ import pLimit from 'p-limit';

});
const schemas = [];
const typeDefs = [];
sources.forEach(source => {
if (source.schema) {
schemas.push(source.schema);
}
else {
typeDefs.push(source.document);
}
});
const { schemas, typeDefs } = collectSchemasAndTypeDefs(sources);
const mergeSchemasOptions = {

@@ -1156,3 +1147,7 @@ schemas,

};
return mergeSchemasAsync(mergeSchemasOptions);
const schema = await mergeSchemasAsync(mergeSchemasOptions);
if (options.includeSources) {
includeSources(schema, sources);
}
return schema;
}

@@ -1164,5 +1159,26 @@ function loadSchemaSync(schemaPointers, options) {

});
const { schemas, typeDefs } = collectSchemasAndTypeDefs(sources);
const mergeSchemasOptions = {
schemas,
typeDefs,
...options,
};
const schema = mergeSchemas(mergeSchemasOptions);
if (options.includeSources) {
includeSources(schema, sources);
}
return schema;
}
function includeSources(schema, sources) {
schema.extensions = {
...schema.extensions,
sources: sources
.filter((source) => source.rawSDL || source.document)
.map((source) => new Source(source.rawSDL || print(source.document), source.location)),
};
}
function collectSchemasAndTypeDefs(sources) {
const schemas = [];
const typeDefs = [];
sources.forEach(source => {
sources.forEach((source) => {
if (source.schema) {

@@ -1175,8 +1191,6 @@ schemas.push(source.schema);

});
const mergeSchemasOptions = {
return {
schemas,
typeDefs,
...options,
};
return mergeSchemas(mergeSchemasOptions);
}

@@ -1183,0 +1197,0 @@

{
"name": "@graphql-toolkit/core",
"version": "0.10.5-alpha-7705fd0.9+7705fd0",
"version": "0.10.5-alpha-7c19cfe.11+7c19cfe",
"description": "A set of utils for faster development of GraphQL tools",

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

"dependencies": {
"@graphql-toolkit/common": "0.10.5-alpha-7705fd0.9+7705fd0",
"@graphql-toolkit/schema-merging": "0.10.5-alpha-7705fd0.9+7705fd0",
"@graphql-toolkit/common": "0.10.5-alpha-7c19cfe.11+7c19cfe",
"@graphql-toolkit/schema-merging": "0.10.5-alpha-7c19cfe.11+7c19cfe",
"aggregate-error": "3.0.1",

@@ -13,0 +13,0 @@ "globby": "11.0.0",

import { LoadTypedefsOptions, UnnormalizedTypeDefPointer } from './load-typedefs';
import { GraphQLSchema, BuildSchemaOptions } from 'graphql';
import { MergeSchemasConfig } from '@graphql-toolkit/schema-merging';
export declare type LoadSchemaOptions = BuildSchemaOptions & LoadTypedefsOptions & Partial<MergeSchemasConfig>;
export declare type LoadSchemaOptions = BuildSchemaOptions & LoadTypedefsOptions & Partial<MergeSchemasConfig> & {
/**
* Adds a list of Sources in to `extensions.sources`
*
* Disabled by default.
*/
includeSources?: boolean;
};
export declare function loadSchema(schemaPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], options: LoadSchemaOptions): Promise<GraphQLSchema>;
export declare function loadSchemaSync(schemaPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], options: LoadSchemaOptions): GraphQLSchema;

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