@@ -3,6 +3,7 @@ import type { CachedContent } from 'graphql-language-service';
3
3
import { Range , Position } from 'graphql-language-service-utils' ;
4
4
5
5
import { findGraphQLTags , DEFAULT_TAGS } from './findGraphQLTags' ;
6
+ import { Logger } from './Logger' ;
6
7
7
8
export const DEFAULT_SUPPORTED_EXTENSIONS = [
8
9
'.js' ,
@@ -17,7 +18,7 @@ export const DEFAULT_SUPPORTED_EXTENSIONS = [
17
18
] ;
18
19
19
20
/**
20
- * .graphql is the officially reccomended extension for graphql files
21
+ * .graphql is the officially recommended extension for graphql files
21
22
*
22
23
* .gql and .graphqls are included for compatibility for commonly used extensions
23
24
*
@@ -43,6 +44,7 @@ export function parseDocument(
43
44
uri : string ,
44
45
fileExtensions : string [ ] = DEFAULT_SUPPORTED_EXTENSIONS ,
45
46
graphQLFileExtensions : string [ ] = DEFAULT_SUPPORTED_GRAPHQL_EXTENSIONS ,
47
+ logger : Logger = new Logger ( ) ,
46
48
) : CachedContent [ ] {
47
49
// Check if the text content includes a GraphQLV query.
48
50
// If the text doesn't include GraphQL queries, do not proceed.
@@ -51,7 +53,7 @@ export function parseDocument(
51
53
if ( DEFAULT_TAGS . some ( t => t === text ) ) {
52
54
return [ ] ;
53
55
}
54
- const templates = findGraphQLTags ( text , ext ) ;
56
+ const templates = findGraphQLTags ( text , ext , uri , logger ) ;
55
57
return templates . map ( ( { template, range } ) => ( { query : template , range } ) ) ;
56
58
}
57
59
if ( graphQLFileExtensions . some ( e => e === ext ) ) {
0 commit comments