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

@graphql-tools/load

Package Overview
Dependencies
Maintainers
3
Versions
1174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-tools/load - npm Package Compare versions

Comparing version 8.0.0-rc-20230519104353-b09f3180 to 8.0.0-rc-20230519104627-f6fea064

10

cjs/load-typedefs/load-file.js

@@ -6,7 +6,6 @@ "use strict";

async function loadFile(pointer, options) {
var _a;
if (process_1.env['DEBUG'] != null) {
console.time(`@graphql-tools/load: loadFile ${pointer}`);
}
let results = (_a = options.cache) === null || _a === void 0 ? void 0 : _a[pointer];
let results = options.cache?.[pointer];
if (!results) {

@@ -18,3 +17,3 @@ results = [];

const loaderResults = await loader.load(pointer, options);
loaderResults === null || loaderResults === void 0 ? void 0 : loaderResults.forEach(result => results.push(result));
loaderResults?.forEach(result => results.push(result));
}

@@ -54,7 +53,6 @@ catch (error) {

function loadFileSync(pointer, options) {
var _a;
if (process_1.env['DEBUG'] != null) {
console.time(`@graphql-tools/load: loadFileSync ${pointer}`);
}
let results = (_a = options.cache) === null || _a === void 0 ? void 0 : _a[pointer];
let results = options.cache?.[pointer];
if (!results) {

@@ -67,3 +65,3 @@ results = [];

const loaderResults = loader.loadSync(pointer, options);
loaderResults === null || loaderResults === void 0 ? void 0 : loaderResults.forEach(result => results.push(result));
loaderResults?.forEach(result => results.push(result));
}

@@ -70,0 +68,0 @@ catch (error) {

3

cjs/load-typedefs/parse.js

@@ -86,7 +86,6 @@ "use strict";

function collectValidSources(input, addValidSource) {
var _a;
if (process_1.env['DEBUG'] != null) {
console.time(`@graphql-tools/load: collectValidSources ${input.source.location}`);
}
if (((_a = input.source.document) === null || _a === void 0 ? void 0 : _a.definitions) && input.source.document.definitions.length > 0) {
if (input.source.document?.definitions && input.source.document.definitions.length > 0) {
addValidSource(input.source);

@@ -93,0 +92,0 @@ }

@@ -62,3 +62,3 @@ "use strict";

});
if (options === null || options === void 0 ? void 0 : options.includeSources) {
if (options?.includeSources) {
includeSources(schema, sources);

@@ -65,0 +65,0 @@ }

@@ -8,3 +8,3 @@ "use strict";

const queue = [];
const limit = (options === null || options === void 0 ? void 0 : options.concurrency) ? (0, p_limit_1.default)(options.concurrency) : async (fn) => fn();
const limit = options?.concurrency ? (0, p_limit_1.default)(options.concurrency) : async (fn) => fn();
return {

@@ -11,0 +11,0 @@ add(fn) {

import { env } from 'process';
export async function loadFile(pointer, options) {
var _a;
if (env['DEBUG'] != null) {
console.time(`@graphql-tools/load: loadFile ${pointer}`);
}
let results = (_a = options.cache) === null || _a === void 0 ? void 0 : _a[pointer];
let results = options.cache?.[pointer];
if (!results) {

@@ -14,3 +13,3 @@ results = [];

const loaderResults = await loader.load(pointer, options);
loaderResults === null || loaderResults === void 0 ? void 0 : loaderResults.forEach(result => results.push(result));
loaderResults?.forEach(result => results.push(result));
}

@@ -49,7 +48,6 @@ catch (error) {

export function loadFileSync(pointer, options) {
var _a;
if (env['DEBUG'] != null) {
console.time(`@graphql-tools/load: loadFileSync ${pointer}`);
}
let results = (_a = options.cache) === null || _a === void 0 ? void 0 : _a[pointer];
let results = options.cache?.[pointer];
if (!results) {

@@ -62,3 +60,3 @@ results = [];

const loaderResults = loader.loadSync(pointer, options);
loaderResults === null || loaderResults === void 0 ? void 0 : loaderResults.forEach(result => results.push(result));
loaderResults?.forEach(result => results.push(result));
}

@@ -65,0 +63,0 @@ catch (error) {

@@ -82,7 +82,6 @@ import { printSchemaWithDirectives, parseGraphQLSDL, printWithComments, resetComments, } from '@graphql-tools/utils';

function collectValidSources(input, addValidSource) {
var _a;
if (env['DEBUG'] != null) {
console.time(`@graphql-tools/load: collectValidSources ${input.source.location}`);
}
if (((_a = input.source.document) === null || _a === void 0 ? void 0 : _a.definitions) && input.source.document.definitions.length > 0) {
if (input.source.document?.definitions && input.source.document.definitions.length > 0) {
addValidSource(input.source);

@@ -89,0 +88,0 @@ }

@@ -57,3 +57,3 @@ import { loadTypedefs, loadTypedefsSync } from './load-typedefs.js';

});
if (options === null || options === void 0 ? void 0 : options.includeSources) {
if (options?.includeSources) {
includeSources(schema, sources);

@@ -60,0 +60,0 @@ }

import pLimit from 'p-limit';
export function useQueue(options) {
const queue = [];
const limit = (options === null || options === void 0 ? void 0 : options.concurrency) ? pLimit(options.concurrency) : async (fn) => fn();
const limit = options?.concurrency ? pLimit(options.concurrency) : async (fn) => fn();
return {

@@ -6,0 +6,0 @@ add(fn) {

{
"name": "@graphql-tools/load",
"version": "8.0.0-rc-20230519104353-b09f3180",
"version": "8.0.0-rc-20230519104627-f6fea064",
"description": "A set of utils for faster development of GraphQL tools",

@@ -10,4 +10,4 @@ "sideEffects": false,

"dependencies": {
"@graphql-tools/utils": "10.0.0-rc-20230519104353-b09f3180",
"@graphql-tools/schema": "10.0.0-rc-20230519104353-b09f3180",
"@graphql-tools/utils": "10.0.0-rc-20230519104627-f6fea064",
"@graphql-tools/schema": "10.0.0-rc-20230519104627-f6fea064",
"p-limit": "3.1.0",

@@ -14,0 +14,0 @@ "tslib": "^2.4.0"

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