File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/plugin/src/processors Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 11import { parseCode } from '@graphql-tools/graphql-tag-pluck' ;
2+ import { basename } from 'path' ;
23
34const RELEVANT_KEYWORDS = [ 'gql' , 'graphql' , '/* GraphQL */' ] ;
45
@@ -19,6 +20,8 @@ export function createGraphqlProcessor() {
1920 const blocks : Block [ ] = [ ] ;
2021 blocksMap . set ( filename , blocks ) ;
2122
23+ const originalFileBlock = { text, filename : `/../../${ basename ( filename ) } ` }
24+
2225 if ( filename && text && RELEVANT_KEYWORDS . some ( keyword => text . includes ( keyword ) ) ) {
2326 const extractedDocuments = parseCode ( {
2427 code : text ,
@@ -39,13 +42,13 @@ export function createGraphqlProcessor() {
3942 } ) ;
4043 }
4144
42- blocks . push ( { text , filename } ) ;
45+ blocks . push ( originalFileBlock ) ;
4346
4447 return blocks ;
4548 }
4649 }
4750
48- return [ { text , filename } ] ;
51+ return [ originalFileBlock ] ;
4952 } ,
5053 postprocess : ( messageLists : any [ ] , filename : string ) : any [ ] => {
5154 const blocks = blocksMap . get ( filename ) ;
You can’t perform that action at this time.
0 commit comments