@graphql-tools/graphql-file-loader 7.2.0 → 7.3.0

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.
Files changed (3) hide show
  1. package/index.js +10 -0
  2. package/index.mjs +10 -0
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -76,11 +76,21 @@ class GraphQLFileLoader {
76
76
  return globs;
77
77
  }
78
78
  async resolveGlobs(glob, options) {
79
+ if (!glob.includes('*') &&
80
+ (await this.canLoad(glob, options)) &&
81
+ !utils.asArray(options.ignore || []).length &&
82
+ !options['includeSources'])
83
+ return [glob]; // bypass globby when no glob character, can be loaded, no ignores and source not requested. Fixes problem with pkg and passes ci tests
79
84
  const globs = this._buildGlobs(glob, options);
80
85
  const result = await globby(globs, createGlobbyOptions(options));
81
86
  return result;
82
87
  }
83
88
  resolveGlobsSync(glob, options) {
89
+ if (!glob.includes('*') &&
90
+ this.canLoadSync(glob, options) &&
91
+ !utils.asArray(options.ignore || []).length &&
92
+ !options['includeSources'])
93
+ return [glob]; // bypass globby when no glob character, can be loaded, no ignores and source not requested. Fixes problem with pkg and passes ci tests
84
94
  const globs = this._buildGlobs(glob, options);
85
95
  const result = globby.sync(globs, createGlobbyOptions(options));
86
96
  return result;
package/index.mjs CHANGED
@@ -70,11 +70,21 @@ class GraphQLFileLoader {
70
70
  return globs;
71
71
  }
72
72
  async resolveGlobs(glob, options) {
73
+ if (!glob.includes('*') &&
74
+ (await this.canLoad(glob, options)) &&
75
+ !asArray(options.ignore || []).length &&
76
+ !options['includeSources'])
77
+ return [glob]; // bypass globby when no glob character, can be loaded, no ignores and source not requested. Fixes problem with pkg and passes ci tests
73
78
  const globs = this._buildGlobs(glob, options);
74
79
  const result = await globby(globs, createGlobbyOptions(options));
75
80
  return result;
76
81
  }
77
82
  resolveGlobsSync(glob, options) {
83
+ if (!glob.includes('*') &&
84
+ this.canLoadSync(glob, options) &&
85
+ !asArray(options.ignore || []).length &&
86
+ !options['includeSources'])
87
+ return [glob]; // bypass globby when no glob character, can be loaded, no ignores and source not requested. Fixes problem with pkg and passes ci tests
78
88
  const globs = this._buildGlobs(glob, options);
79
89
  const result = globby.sync(globs, createGlobbyOptions(options));
80
90
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/graphql-file-loader",
3
- "version": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {