@@ -716,19 +716,17 @@ async function generateRenderResponse(
716716 runningAction : false ,
717717 } ;
718718
719- const queryOptions = routeIdsToLoad
720- ? {
721- filterMatchesToLoad : ( m : AgnosticDataRouteMatch ) =>
722- routeIdsToLoad ! . includes ( m . route . id ) ,
723- }
724- : { } ;
725-
726719 const result = await ServerStorage . run ( ctx , ( ) =>
727720 staticHandler . query ( request , {
728721 requestContext,
729722 skipLoaderErrorBubbling : isDataRequest ,
730723 skipRevalidation : isSubmission ,
731- ...queryOptions ,
724+ ...( routeIdsToLoad
725+ ? {
726+ filterMatchesToLoad : ( m : AgnosticDataRouteMatch ) =>
727+ routeIdsToLoad ! . includes ( m . route . id ) ,
728+ }
729+ : { } ) ,
732730 async unstable_generateMiddlewareResponse ( query ) {
733731 // If this is an RSC server action, process that and then call query as a
734732 // revalidation. If this is a RR Form/Fetcher submission,
@@ -780,11 +778,14 @@ async function generateRenderResponse(
780778 }
781779 }
782780
783- if ( skipRevalidation ) {
784- queryOptions . filterMatchesToLoad = ( ) => false ;
785- }
786-
787- let staticContext = await query ( request , queryOptions ) ;
781+ let staticContext = await query (
782+ request ,
783+ skipRevalidation
784+ ? {
785+ filterMatchesToLoad : ( ) => false ,
786+ }
787+ : undefined ,
788+ ) ;
788789
789790 if ( isResponse ( staticContext ) ) {
790791 return generateRedirectResponse (
0 commit comments