Skip to content

Commit f8e01d3

Browse files
1.0.4
1 parent e52c119 commit f8e01d3

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

dist/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
55
Object.defineProperty(exports, "__esModule", { value: true });
66
exports.GraphQLQueryPurifier = void 0;
77
const fs_1 = __importDefault(require("fs"));
8-
const glob_1 = __importDefault(require("glob"));
8+
const glob_1 = require("glob");
99
const graphql_1 = require("graphql");
1010
const path_1 = __importDefault(require("path"));
1111
const merge_1 = require("./merge");
@@ -47,8 +47,8 @@ class GraphQLQueryPurifier {
4747
this.allowAll = allowAll;
4848
this.allowStudio = allowStudio;
4949
}
50-
loadQueries() {
51-
const files = glob_1.default.sync(`${this.gqlPath}/**/*.gql`);
50+
async loadQueries() {
51+
const files = await (0, glob_1.glob)(`${this.gqlPath}/**/*.gql`);
5252
files.forEach((file) => {
5353
if (path_1.default.extname(file) === '.gql') {
5454
const content = fs_1.default.readFileSync(file, 'utf8');

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@
3030
"@types/jest": "^29.5.7",
3131
"@types/node": "^20.8.10",
3232
"eslint": "^8.53.0",
33+
"glob": "^10.3.10",
3334
"graphql": "^16.8.1",
3435
"jest": "^29.7.0",
3536
"prettier": "^3.0.3",
3637
"terser": "^5.24.0",
3738
"ts-jest": "^29.1.1",
3839
"typescript": "^5.2.2"
3940
}
40-
}
41+
}

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NextFunction, Request, Response } from 'express';
22
import fs from 'fs';
3-
import glob from 'glob';
3+
import { glob } from 'glob';
44
import { OperationDefinitionNode, parse } from 'graphql';
55
import path from 'path';
66

@@ -28,8 +28,8 @@ export class GraphQLQueryPurifier {
2828
this.allowStudio = allowStudio;
2929
}
3030

31-
private loadQueries() {
32-
const files = glob.sync(`${this.gqlPath}/**/*.gql`);
31+
private async loadQueries() {
32+
const files = await glob(`${this.gqlPath}/**/*.gql`);
3333

3434
files.forEach((file) => {
3535
if (path.extname(file) === '.gql') {

yarn.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2195,6 +2195,7 @@ __metadata:
21952195
"@types/jest": ^29.5.7
21962196
"@types/node": ^20.8.10
21972197
eslint: ^8.53.0
2198+
glob: ^10.3.10
21982199
graphql: ^16.8.1
21992200
jest: ^29.7.0
22002201
prettier: ^3.0.3

0 commit comments

Comments
 (0)