@graphql-tools/webpack-loader
Advanced tools
Comparing version 6.0.11-alpha-d958e71.0 to 6.0.11
@@ -6,2 +6,3 @@ 'use strict'; | ||
const graphql = require('graphql'); | ||
const loaderUtils = require('loader-utils'); | ||
@@ -11,8 +12,11 @@ function index (path) { | ||
this.cacheable(); | ||
const options = loaderUtils.getOptions(this); | ||
load.loadTypedefs(path, { | ||
loaders: [new graphqlFileLoader.GraphQLFileLoader()], | ||
noLocation: true, | ||
...options, | ||
}).then(sources => { | ||
const documents = sources.map(source => source.document); | ||
const mergedDoc = graphql.concatAST(documents); | ||
return callback(null, `module.exports = ${JSON.stringify(mergedDoc)}`); | ||
return callback(null, `export default ${JSON.stringify(mergedDoc)}`); | ||
}); | ||
@@ -19,0 +23,0 @@ } |
import { loadTypedefs } from '@graphql-tools/load'; | ||
import { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader'; | ||
import { concatAST } from 'graphql'; | ||
import { getOptions } from 'loader-utils'; | ||
@@ -8,8 +9,11 @@ function index (path) { | ||
this.cacheable(); | ||
const options = getOptions(this); | ||
loadTypedefs(path, { | ||
loaders: [new GraphQLFileLoader()], | ||
noLocation: true, | ||
...options, | ||
}).then(sources => { | ||
const documents = sources.map(source => source.document); | ||
const mergedDoc = concatAST(documents); | ||
return callback(null, `module.exports = ${JSON.stringify(mergedDoc)}`); | ||
return callback(null, `export default ${JSON.stringify(mergedDoc)}`); | ||
}); | ||
@@ -16,0 +20,0 @@ } |
{ | ||
"name": "@graphql-tools/webpack-loader", | ||
"version": "6.0.11-alpha-d958e71.0", | ||
"version": "6.0.11", | ||
"description": "A set of utils for faster development of GraphQL tools", | ||
@@ -10,4 +10,5 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@graphql-tools/load": "6.0.11-alpha-d958e71.0", | ||
"@graphql-tools/graphql-file-loader": "6.0.11-alpha-d958e71.0", | ||
"@graphql-tools/load": "6.0.11", | ||
"@graphql-tools/graphql-file-loader": "6.0.11", | ||
"loader-utils": "2.0.0", | ||
"tslib": "~2.0.0" | ||
@@ -23,2 +24,5 @@ }, | ||
}, | ||
"devDependencies": { | ||
"@types/loader-utils": "2.0.1" | ||
}, | ||
"publishConfig": { | ||
@@ -25,0 +29,0 @@ "access": "public" |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5278
42
1
5
1
+ Addedloader-utils@2.0.0
+ Added@ardatan/aggregate-error@0.0.1(transitive)
+ Added@graphql-tools/graphql-file-loader@6.0.11(transitive)
+ Added@graphql-tools/import@6.0.11(transitive)
+ Added@graphql-tools/load@6.0.11(transitive)
+ Added@graphql-tools/merge@6.0.11(transitive)
+ Added@graphql-tools/schema@6.0.11(transitive)
+ Added@graphql-tools/utils@6.0.11(transitive)
+ Addedbig.js@5.2.2(transitive)
+ Addedemojis-list@3.0.0(transitive)
+ Addedjson5@2.2.3(transitive)
+ Addedloader-utils@2.0.0(transitive)
- Removed@graphql-tools/graphql-file-loader@6.0.11-alpha-d958e71.0(transitive)
- Removed@graphql-tools/import@6.0.11-alpha-d958e71.0(transitive)
- Removed@graphql-tools/load@6.0.11-alpha-d958e71.0(transitive)
- Removed@graphql-tools/merge@6.0.11-alpha-d958e71.0(transitive)
- Removed@graphql-tools/schema@6.0.11-alpha-d958e71.0(transitive)
- Removed@graphql-tools/utils@6.0.11-alpha-d958e71.0(transitive)
- Removedaggregate-error@3.0.1(transitive)
- Removedclean-stack@2.2.0(transitive)
- Removedindent-string@4.0.0(transitive)
Updated@graphql-tools/load@6.0.11