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

@graphql-inspector/loaders

Package Overview
Dependencies
Maintainers
2
Versions
427
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-inspector/loaders - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

15

index.cjs.js

@@ -5,3 +5,3 @@ 'use strict';

const core = require('@graphql-toolkit/core');
const load = require('@graphql-tools/load');

@@ -12,6 +12,9 @@ class LoadersRegistry {

}
register(loaderName) {
register(loader) {
this.loaders.push(loader);
}
registerModule(loaderName) {
try {
const loader = loadModule(`@graphql-inspector/${loaderName}-loader`);
this.loaders.push(loader);
this.register(loader);
}

@@ -24,6 +27,6 @@ catch (error) {

loadSchema(pointer, options = {}) {
return core.loadSchema(pointer, Object.assign({ loaders: this.loaders, assumeValid: true, assumeValidSDL: true }, options));
return load.loadSchema(pointer, Object.assign({ loaders: this.loaders }, options));
}
loadDocuments(pointer, options = {}) {
return core.loadDocuments(pointer, Object.assign({ loaders: this.loaders, assumeValid: true, assumeValidSDL: true }, options));
return load.loadDocuments(pointer, Object.assign({ loaders: this.loaders }, options));
}

@@ -33,3 +36,3 @@ }

const loaders = new LoadersRegistry();
config.loaders.forEach((loaderName) => loaders.register(loaderName));
config.loaders.forEach((loaderName) => loaders.registerModule(loaderName));
return loaders;

@@ -36,0 +39,0 @@ }

7

index.d.ts
import { InspectorConfig } from '@graphql-inspector/config';
import { SchemaPointerSingle, Source } from '@graphql-toolkit/common';
import { LoadSchemaOptions, LoadTypedefsOptions } from '@graphql-toolkit/core';
import { Source, UniversalLoader, SchemaPointerSingle } from '@graphql-tools/utils';
import { LoadSchemaOptions, LoadTypedefsOptions } from '@graphql-tools/load';
import { GraphQLSchema } from 'graphql';
export declare class LoadersRegistry {
private loaders;
register(loaderName: string): void;
register(loader: UniversalLoader): void;
registerModule(loaderName: string): void;
loadSchema(pointer: SchemaPointerSingle, options?: Omit<LoadSchemaOptions, 'loaders'>): Promise<GraphQLSchema>;

@@ -9,0 +10,0 @@ loadDocuments(pointer: SchemaPointerSingle, options?: Omit<LoadTypedefsOptions, 'loaders'>): Promise<Source[]>;

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

import { loadSchema, loadDocuments } from '@graphql-toolkit/core';
import { loadSchema, loadDocuments } from '@graphql-tools/load';

@@ -7,6 +7,9 @@ class LoadersRegistry {

}
register(loaderName) {
register(loader) {
this.loaders.push(loader);
}
registerModule(loaderName) {
try {
const loader = loadModule(`@graphql-inspector/${loaderName}-loader`);
this.loaders.push(loader);
this.register(loader);
}

@@ -19,6 +22,6 @@ catch (error) {

loadSchema(pointer, options = {}) {
return loadSchema(pointer, Object.assign({ loaders: this.loaders, assumeValid: true, assumeValidSDL: true }, options));
return loadSchema(pointer, Object.assign({ loaders: this.loaders }, options));
}
loadDocuments(pointer, options = {}) {
return loadDocuments(pointer, Object.assign({ loaders: this.loaders, assumeValid: true, assumeValidSDL: true }, options));
return loadDocuments(pointer, Object.assign({ loaders: this.loaders }, options));
}

@@ -28,3 +31,3 @@ }

const loaders = new LoadersRegistry();
config.loaders.forEach((loaderName) => loaders.register(loaderName));
config.loaders.forEach((loaderName) => loaders.registerModule(loaderName));
return loaders;

@@ -31,0 +34,0 @@ }

{
"name": "@graphql-inspector/loaders",
"version": "2.0.1",
"version": "2.1.0",
"description": "Loaders in GraphQL Inspector",
"sideEffects": false,
"peerDependencies": {
"@graphql-inspector/config": "2.0.1",
"@graphql-toolkit/common": "~0.10.3",
"@graphql-inspector/config": "2.1.0",
"@graphql-tools/utils": "^6.0.0",
"graphql": "^0.13.0 || ^14.0.0 || ^15.0.0"
},
"dependencies": {
"@graphql-toolkit/core": "~0.10.3",
"@graphql-tools/load": "^6.0.0",
"tslib": "^2.0.0"

@@ -13,0 +14,0 @@ },

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