@graphql-inspector/loaders
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -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 @@ } |
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
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
9291
88
+ Added@graphql-tools/load@^6.0.0
+ Added@ardatan/aggregate-error@0.0.6(transitive)
+ Added@graphql-inspector/config@2.1.0(transitive)
+ Added@graphql-tools/load@6.2.8(transitive)
+ Added@graphql-tools/merge@6.2.178.3.1(transitive)
+ Added@graphql-tools/schema@8.5.1(transitive)
+ Added@graphql-tools/utils@6.2.47.10.08.0.28.9.0(transitive)
+ Addedcamel-case@4.1.2(transitive)
+ Addedglobby@11.0.3(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedtslib@2.0.32.2.02.3.1(transitive)
+ Addedvalue-or-promise@1.0.11(transitive)
+ Addedyocto-queue@0.1.0(transitive)
- Removed@graphql-toolkit/core@~0.10.3
- Removed@babel/runtime@7.26.0(transitive)
- Removed@graphql-inspector/config@2.0.1(transitive)
- Removed@graphql-toolkit/common@0.10.7(transitive)
- Removed@graphql-toolkit/core@0.10.7(transitive)
- Removed@graphql-toolkit/schema-merging@0.10.7(transitive)
- Removed@wry/equality@0.1.11(transitive)
- Removedaggregate-error@3.0.1(transitive)
- Removedapollo-link@1.2.14(transitive)
- Removedapollo-link-http-common@0.2.16(transitive)
- Removedapollo-upload-client@13.0.0(transitive)
- Removedapollo-utilities@1.3.4(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedclean-stack@2.2.0(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removeddeepmerge@4.2.2(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removeddeprecated-decorator@0.1.6(transitive)
- Removedextract-files@8.1.0(transitive)
- Removedfast-json-stable-stringify@2.1.0(transitive)
- Removedform-data@3.0.2(transitive)
- Removedglobby@11.0.0(transitive)
- Removedgraphql-tools@5.0.0(transitive)
- Removedindent-string@4.0.0(transitive)
- Removediterall@1.3.0(transitive)
- Removedlodash@4.17.15(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedp-limit@2.3.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedregenerator-runtime@0.14.1(transitive)
- Removedtr46@0.0.3(transitive)
- Removedts-invariant@0.4.4(transitive)
- Removedtslib@1.11.2(transitive)
- Removeduuid@7.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)
- Removedzen-observable@0.8.15(transitive)
- Removedzen-observable-ts@0.8.21(transitive)