File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
55Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
66exports . GraphQLQueryPurifier = void 0 ;
77const fs_1 = __importDefault ( require ( "fs" ) ) ;
8- const glob_1 = __importDefault ( require ( "glob" ) ) ;
8+ const glob_1 = require ( "glob" ) ;
99const graphql_1 = require ( "graphql" ) ;
1010const path_1 = __importDefault ( require ( "path" ) ) ;
1111const 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' ) ;
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 11import { NextFunction , Request , Response } from 'express' ;
22import fs from 'fs' ;
3- import glob from 'glob' ;
3+ import { glob } from 'glob' ;
44import { OperationDefinitionNode , parse } from 'graphql' ;
55import 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' ) {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments