( arg1: TQueryKey | TOptions, arg2?: QueryFunction<any, TQueryKey> | TOptions, arg3?: TOptions )
| 114 | } |
| 115 | |
| 116 | export function parseQueryArgs< |
| 117 | TOptions extends QueryOptions<any, any, any, TQueryKey>, |
| 118 | TQueryKey extends QueryKey = QueryKey |
| 119 | >( |
| 120 | arg1: TQueryKey | TOptions, |
| 121 | arg2?: QueryFunction<any, TQueryKey> | TOptions, |
| 122 | arg3?: TOptions |
| 123 | ): TOptions { |
| 124 | if (!isQueryKey(arg1)) { |
| 125 | return arg1 as TOptions |
| 126 | } |
| 127 | |
| 128 | if (typeof arg2 === 'function') { |
| 129 | return { ...arg3, queryKey: arg1, queryFn: arg2 } as TOptions |
| 130 | } |
| 131 | |
| 132 | return { ...arg2, queryKey: arg1 } as TOptions |
| 133 | } |
| 134 | |
| 135 | export function parseMutationArgs< |
| 136 | TOptions extends MutationOptions<any, any, any, any> |
no test coverage detected
searching dependent graphs…