@coderich/autograph 0.9.3 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/Schema.js +2 -2
- package/src/graphql/ast/Schema.js +3 -3
package/package.json
CHANGED
package/src/core/Schema.js
CHANGED
|
@@ -50,8 +50,8 @@ module.exports = class extends Schema {
|
|
|
50
50
|
this.modelsByKey = this.models.reduce((prev, model) => Object.assign(prev, { [model.getKey()]: model }), {});
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
loadDir(dir) {
|
|
54
|
-
super.loadDir(dir);
|
|
53
|
+
loadDir(dir, options) {
|
|
54
|
+
super.loadDir(dir, options);
|
|
55
55
|
this.createModels();
|
|
56
56
|
return this;
|
|
57
57
|
}
|
|
@@ -106,12 +106,12 @@ module.exports = class Schema extends Node {
|
|
|
106
106
|
return this.schema.context;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
loadDir(dir) {
|
|
109
|
+
loadDir(dir, options) {
|
|
110
110
|
// Typedefs
|
|
111
|
-
const typeDefs = Glob.sync(`${dir}/**/*.{gql,graphql}
|
|
111
|
+
const typeDefs = Glob.sync(`${dir}/**/*.{gql,graphql}`, options).map(file => loadFile(file)).join('\n\n');
|
|
112
112
|
|
|
113
113
|
// Possibly full schema definitions
|
|
114
|
-
const schema = Glob.sync(`${dir}/**/*.js
|
|
114
|
+
const schema = Glob.sync(`${dir}/**/*.js`, options).map(file => reqFile(file)).reduce((prev, data) => {
|
|
115
115
|
return Merge(prev, data);
|
|
116
116
|
}, {
|
|
117
117
|
typeDefs: typeDefs.length ? typeDefs : undefined,
|