File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,29 +21,12 @@ type QueryBaseHookOptions = Omit<
2121 variables ?: any
2222}
2323
24- const existedPrimaryKeys = new Set < string > ( )
25-
2624export const createBaseQuery = (
2725 defaultOptions : any ,
2826 useRQHook : ( options : any , queryClient ?: any ) => any ,
2927 overrideOptions ?: QueryBaseHookOptions
3028) : any => {
31- const {
32- primaryKey,
33- queryFn,
34- queryKeyHashFn,
35- getPreviousPageParam,
36- getNextPageParam,
37- initialPageParam,
38- } = defaultOptions as CreateBaseQueryOptions
39-
4029 if ( process . env . NODE_ENV !== 'production' ) {
41- if ( existedPrimaryKeys . has ( primaryKey ) ) {
42- console . error ( `[Bug] Duplicated primaryKey: ${ primaryKey } ` )
43- } else {
44- existedPrimaryKeys . add ( primaryKey )
45- }
46-
4730 // @ts -ignore
4831 if ( defaultOptions . useDefaultOptions ) {
4932 console . error (
@@ -52,6 +35,15 @@ export const createBaseQuery = (
5235 }
5336 }
5437
38+ const {
39+ primaryKey,
40+ queryFn,
41+ queryKeyHashFn,
42+ getPreviousPageParam,
43+ getNextPageParam,
44+ initialPageParam,
45+ } = defaultOptions as CreateBaseQueryOptions
46+
5547 const getPrimaryKey = ( ) => primaryKey
5648
5749 const getKey = ( variables ?: any ) => getQueryKey ( primaryKey , variables )
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ export const suspenseOptions = {
3939 enabled : true ,
4040 suspense : true ,
4141 throwOnError : true ,
42+ // Compatible with ReactQuery v4
4243 useErrorBoundary : true ,
4344}
4445
You can’t perform that action at this time.
0 commit comments