( url: string, ...params: [unknown] | [] )
| 115 | |
| 116 | type BlitzQueryKey = [string] | [string, any] |
| 117 | export const getQueryKeyFromUrlAndParams = ( |
| 118 | url: string, |
| 119 | ...params: [unknown] | [] |
| 120 | ): BlitzQueryKey => { |
| 121 | const queryKey: BlitzQueryKey = [url] |
| 122 | if (params.length === 1) { |
| 123 | const param = params[0] |
| 124 | queryKey.push(serialize(typeof param === "function" ? param() : param) as any) |
| 125 | } |
| 126 | |
| 127 | return queryKey |
| 128 | } |
| 129 | |
| 130 | export function getQueryKey<TInput, TResult, T extends AsyncFunc>( |
| 131 | resolver: T | Resolver<TInput, TResult> | RpcClient<TInput, TResult>, |
no outgoing calls
no test coverage detected