@@ -573,6 +573,7 @@ export function buildThunks<
573
573
argSchema ,
574
574
finalQueryArg ,
575
575
'argSchema' ,
576
+ { } , // we don't have a meta yet, so we can't pass it
576
577
)
577
578
}
578
579
@@ -636,6 +637,7 @@ export function buildThunks<
636
637
rawResponseSchema ,
637
638
result . data ,
638
639
'rawResponseSchema' ,
640
+ result . meta ,
639
641
)
640
642
}
641
643
@@ -650,6 +652,7 @@ export function buildThunks<
650
652
responseSchema ,
651
653
transformedResponse ,
652
654
'responseSchema' ,
655
+ result . meta ,
653
656
)
654
657
}
655
658
@@ -747,6 +750,7 @@ export function buildThunks<
747
750
metaSchema ,
748
751
finalQueryReturnValue . meta ,
749
752
'metaSchema' ,
753
+ finalQueryReturnValue . meta ,
750
754
)
751
755
}
752
756
@@ -777,11 +781,12 @@ export function buildThunks<
777
781
rawErrorResponseSchema ,
778
782
value ,
779
783
'rawErrorResponseSchema' ,
784
+ meta ,
780
785
)
781
786
}
782
787
783
788
if ( metaSchema && ! skipSchemaValidation ) {
784
- meta = await parseWithSchema ( metaSchema , meta , 'metaSchema' )
789
+ meta = await parseWithSchema ( metaSchema , meta , 'metaSchema' , meta )
785
790
}
786
791
let transformedErrorResponse = await transformErrorResponse (
787
792
value ,
@@ -793,6 +798,7 @@ export function buildThunks<
793
798
errorResponseSchema ,
794
799
transformedErrorResponse ,
795
800
'errorResponseSchema' ,
801
+ meta ,
796
802
)
797
803
}
798
804
@@ -816,7 +822,7 @@ export function buildThunks<
816
822
if ( catchSchemaFailure ) {
817
823
return rejectWithValue (
818
824
catchSchemaFailure ( caughtError , info ) ,
819
- addShouldAutoBatch ( { baseQueryMeta : { } } ) , // TODO: how do we get meta here?
825
+ addShouldAutoBatch ( { baseQueryMeta : caughtError . _bqMeta } ) ,
820
826
)
821
827
}
822
828
}
0 commit comments