File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
packages/query-core/src/__tests__ Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -714,6 +714,28 @@ describe('queryClient', () => {
714714 expect ( third ) . toBe ( 1 )
715715 expect ( fourth ) . toBe ( 2 )
716716 } )
717+
718+ test ( 'should allow new meta' , async ( ) => {
719+ const key = queryKey ( )
720+
721+ const first = await queryClient . fetchQuery ( {
722+ queryKey : key ,
723+ queryFn : ( { meta } ) => Promise . resolve ( meta ) ,
724+ meta : {
725+ foo : true ,
726+ } ,
727+ } )
728+ expect ( first ) . toStrictEqual ( { foo : true } )
729+
730+ const second = await queryClient . fetchQuery ( {
731+ queryKey : key ,
732+ queryFn : ( { meta } ) => Promise . resolve ( meta ) ,
733+ meta : {
734+ foo : false ,
735+ } ,
736+ } )
737+ expect ( second ) . toStrictEqual ( { foo : false } )
738+ } )
717739 } )
718740
719741 describe ( 'fetchInfiniteQuery' , ( ) => {
You can’t perform that action at this time.
0 commit comments