@@ -309,39 +309,39 @@ export function useModelQueries<Schema extends SchemaDef, Model extends GetModel
309309 } ,
310310
311311 useCreate : ( options ?: any ) => {
312- return useInternalMutation ( schema , modelName , 'POST' , 'create' , options , true ) ;
312+ return useInternalMutation ( schema , modelName , 'POST' , 'create' , options ) ;
313313 } ,
314314
315315 useCreateMany : ( options ?: any ) => {
316- return useInternalMutation ( schema , modelName , 'POST' , 'createMany' , options , false ) ;
316+ return useInternalMutation ( schema , modelName , 'POST' , 'createMany' , options ) ;
317317 } ,
318318
319319 useCreateManyAndReturn : ( options ?: any ) => {
320- return useInternalMutation ( schema , modelName , 'POST' , 'createManyAndReturn' , options , true ) ;
320+ return useInternalMutation ( schema , modelName , 'POST' , 'createManyAndReturn' , options ) ;
321321 } ,
322322
323323 useUpdate : ( options ?: any ) => {
324- return useInternalMutation ( schema , modelName , 'PUT' , 'update' , options , true ) ;
324+ return useInternalMutation ( schema , modelName , 'PUT' , 'update' , options ) ;
325325 } ,
326326
327327 useUpdateMany : ( options ?: any ) => {
328- return useInternalMutation ( schema , modelName , 'PUT' , 'updateMany' , options , false ) ;
328+ return useInternalMutation ( schema , modelName , 'PUT' , 'updateMany' , options ) ;
329329 } ,
330330
331331 useUpdateManyAndReturn : ( options ?: any ) => {
332- return useInternalMutation ( schema , modelName , 'PUT' , 'updateManyAndReturn' , options , true ) ;
332+ return useInternalMutation ( schema , modelName , 'PUT' , 'updateManyAndReturn' , options ) ;
333333 } ,
334334
335335 useUpsert : ( options ?: any ) => {
336- return useInternalMutation ( schema , modelName , 'POST' , 'upsert' , options , true ) ;
336+ return useInternalMutation ( schema , modelName , 'POST' , 'upsert' , options ) ;
337337 } ,
338338
339339 useDelete : ( options ?: any ) => {
340- return useInternalMutation ( schema , modelName , 'DELETE' , 'delete' , options , true ) ;
340+ return useInternalMutation ( schema , modelName , 'DELETE' , 'delete' , options ) ;
341341 } ,
342342
343343 useDeleteMany : ( options ?: any ) => {
344- return useInternalMutation ( schema , modelName , 'DELETE' , 'deleteMany' , options , false ) ;
344+ return useInternalMutation ( schema , modelName , 'DELETE' , 'deleteMany' , options ) ;
345345 } ,
346346
347347 useCount : ( options ?: any ) => {
@@ -387,7 +387,7 @@ export function useInternalQuery<TQueryFnData, TData>(
387387 queryKey,
388388 ...useQuery ( {
389389 queryKey,
390- queryFn : ( { signal } ) => fetcher < TQueryFnData , false > ( reqUrl , { signal } , fetch , false ) ,
390+ queryFn : ( { signal } ) => fetcher < TQueryFnData > ( reqUrl , { signal } , fetch ) ,
391391 ...options ,
392392 } ) ,
393393 } ;
@@ -410,7 +410,7 @@ export function useInternalSuspenseQuery<TQueryFnData, TData>(
410410 queryKey,
411411 ...useSuspenseQuery ( {
412412 queryKey,
413- queryFn : ( { signal } ) => fetcher < TQueryFnData , false > ( reqUrl , { signal } , fetch , false ) ,
413+ queryFn : ( { signal } ) => fetcher < TQueryFnData > ( reqUrl , { signal } , fetch ) ,
414414 ...options ,
415415 } ) ,
416416 } ;
@@ -436,12 +436,7 @@ export function useInternalInfiniteQuery<TQueryFnData, TData>(
436436 ...useInfiniteQuery ( {
437437 queryKey,
438438 queryFn : ( { pageParam, signal } ) => {
439- return fetcher < TQueryFnData , false > (
440- makeUrl ( endpoint , model , operation , pageParam ?? args ) ,
441- { signal } ,
442- fetch ,
443- false ,
444- ) ;
439+ return fetcher < TQueryFnData > ( makeUrl ( endpoint , model , operation , pageParam ?? args ) , { signal } , fetch ) ;
445440 } ,
446441 initialPageParam : args ,
447442 ...options ,
@@ -466,12 +461,7 @@ export function useInternalSuspenseInfiniteQuery<TQueryFnData, TData>(
466461 ...useSuspenseInfiniteQuery ( {
467462 queryKey,
468463 queryFn : ( { pageParam, signal } ) => {
469- return fetcher < TQueryFnData , false > (
470- makeUrl ( endpoint , model , operation , pageParam ?? args ) ,
471- { signal } ,
472- fetch ,
473- false ,
474- ) ;
464+ return fetcher < TQueryFnData > ( makeUrl ( endpoint , model , operation , pageParam ?? args ) , { signal } , fetch ) ;
475465 } ,
476466 initialPageParam : args ,
477467 ...options ,
@@ -490,18 +480,12 @@ export function useInternalSuspenseInfiniteQuery<TQueryFnData, TData>(
490480 * @param options The react-query options.
491481 * @param checkReadBack Whether to check for read back errors and return undefined if found.
492482 */
493- export function useInternalMutation <
494- TArgs ,
495- R = any ,
496- C extends boolean = boolean ,
497- Result = C extends true ? R | undefined : R ,
498- > (
483+ export function useInternalMutation < TArgs , R = any > (
499484 schema : SchemaDef ,
500485 model : string ,
501486 method : 'POST' | 'PUT' | 'DELETE' ,
502487 operation : string ,
503- options ?: Omit < UseMutationOptions < Result , DefaultError , TArgs > , 'mutationFn' > & ExtraMutationOptions ,
504- checkReadBack ?: C ,
488+ options ?: Omit < UseMutationOptions < R , DefaultError , TArgs > , 'mutationFn' > & ExtraMutationOptions ,
505489) {
506490 const { endpoint, fetch, logging } = useHooksContext ( ) ;
507491 const queryClient = useQueryClient ( ) ;
@@ -517,7 +501,7 @@ export function useInternalMutation<
517501 body : marshal ( data ) ,
518502 } ) ,
519503 } ;
520- return fetcher < R , C > ( reqUrl , fetchInit , fetch , checkReadBack ) as Promise < Result > ;
504+ return fetcher < R > ( reqUrl , fetchInit , fetch ) as Promise < R > ;
521505 } ;
522506
523507 const finalOptions = { ...options , mutationFn } ;
0 commit comments