@graphql-tools/webpack-loader
Advanced tools
Comparing version 6.0.11-alpha-bff7610.0 to 6.0.11-alpha-c2c0d43.0
@@ -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-bff7610.0", | ||
"version": "6.0.11-alpha-c2c0d43.0", | ||
"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-bff7610.0", | ||
"@graphql-tools/graphql-file-loader": "6.0.11-alpha-bff7610.0", | ||
"@graphql-tools/load": "6.0.11-alpha-c2c0d43.0", | ||
"@graphql-tools/graphql-file-loader": "6.0.11-alpha-c2c0d43.0", | ||
"loader-utils": "2.0.0", | ||
"tslib": "~2.0.0" | ||
@@ -23,2 +24,5 @@ }, | ||
}, | ||
"devDependencies": { | ||
"@types/loader-utils": "1.1.3" | ||
}, | ||
"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
5326
42
5
1
+ Addedloader-utils@2.0.0
+ Added@graphql-tools/graphql-file-loader@6.0.11-alpha-c2c0d43.0(transitive)
+ Added@graphql-tools/import@6.0.11-alpha-c2c0d43.0(transitive)
+ Added@graphql-tools/load@6.0.11-alpha-c2c0d43.0(transitive)
+ Added@graphql-tools/merge@6.0.11-alpha-c2c0d43.0(transitive)
+ Added@graphql-tools/schema@6.0.11-alpha-c2c0d43.0(transitive)
+ Added@graphql-tools/utils@6.0.11-alpha-c2c0d43.0(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-bff7610.0(transitive)
- Removed@graphql-tools/import@6.0.11-alpha-bff7610.0(transitive)
- Removed@graphql-tools/load@6.0.11-alpha-bff7610.0(transitive)
- Removed@graphql-tools/merge@6.0.11-alpha-bff7610.0(transitive)
- Removed@graphql-tools/schema@6.0.11-alpha-bff7610.0(transitive)
- Removed@graphql-tools/utils@6.0.11-alpha-bff7610.0(transitive)
Updated@graphql-tools/graphql-file-loader@6.0.11-alpha-c2c0d43.0