@@ -641,6 +641,8 @@ async function startServer(
641641
642642 currentSourceMapsClientResponse = sourceMapResponse ;
643643
644+ isFilteredGraph = ! ! ( focus || exclude . length > 0 ) ;
645+
644646 const app = http . createServer ( async ( req , res ) => {
645647 // parse URL
646648 const parsedUrl = new URL ( req . url , `http://${ host } :${ port } ` ) ;
@@ -653,6 +655,21 @@ async function startServer(
653655
654656 const sanitizePath = basename ( parsedUrl . pathname ) ;
655657 if ( sanitizePath === 'project-graph.json' ) {
658+ const requestFull = parsedUrl . searchParams . get ( 'full' ) === 'true' ;
659+
660+ // If client requests full graph and current is filtered, regenerate
661+ if ( requestFull && isFilteredGraph ) {
662+ const { projectGraphClientResponse, sourceMapResponse } =
663+ await createProjectGraphAndSourceMapClientResponse ( [ ] , null , [ ] ) ;
664+
665+ currentProjectGraphClientResponse = projectGraphClientResponse ;
666+ currentProjectGraphClientResponse . focus = null ;
667+ currentProjectGraphClientResponse . groupByFolder = false ;
668+ currentProjectGraphClientResponse . exclude = [ ] ;
669+ currentSourceMapsClientResponse = sourceMapResponse ;
670+ isFilteredGraph = false ;
671+ }
672+
656673 res . writeHead ( 200 , { 'Content-Type' : 'application/json' } ) ;
657674 res . end ( JSON . stringify ( currentProjectGraphClientResponse ) ) ;
658675 return ;
@@ -802,6 +819,7 @@ let currentProjectGraphClientResponse: ProjectGraphClientResponse = {
802819 errors : [ ] ,
803820} ;
804821let currentSourceMapsClientResponse : ConfigurationSourceMaps = { } ;
822+ let isFilteredGraph = false ;
805823
806824function debounce ( fn : ( ...args ) => void , time : number ) {
807825 let timeout : NodeJS . Timeout ;
@@ -834,8 +852,8 @@ function createFileWatcher() {
834852 const { projectGraphClientResponse, sourceMapResponse } =
835853 await createProjectGraphAndSourceMapClientResponse (
836854 [ ] ,
837- currentProjectGraphClientResponse . focus ,
838- currentProjectGraphClientResponse . exclude
855+ isFilteredGraph ? currentProjectGraphClientResponse . focus : null ,
856+ isFilteredGraph ? currentProjectGraphClientResponse . exclude : [ ]
839857 ) ;
840858
841859 if (
0 commit comments