We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 586e4ee commit 1bf974eCopy full SHA for 1bf974e
src/index.ts
@@ -1,9 +1,14 @@
1
-import { importSchema } from 'graphql-import'
+import { importSchema, parseSDL } from 'graphql-import'
2
+import { dirname, resolve } from 'path'
3
-export default function(source) {
4
- const callback = this.async();
+export default function (source) {
5
+ const callback = this.async()
6
7
this.cacheable()
8
- callback(null, `module.exports = \`${importSchema(source).replace(/`/g, '\\`')}\``)
9
+ parseSDL(source).forEach(rawModule => {
10
+ this.addDependency(resolve(dirname(this.resourcePath), rawModule.from))
11
+ })
12
+
13
+ callback(null, `module.exports = \`${importSchema(this.resourcePath).replace(/`/g, '\\`')}\``)
14
}
0 commit comments