| 110 | const sortConfig = resolveSortInput(sort); |
| 111 | |
| 112 | function getQueryKeyBase() { |
| 113 | const parts: string[] = [definition.config.name]; |
| 114 | |
| 115 | if (queryName) { |
| 116 | parts.push(queryName); |
| 117 | } |
| 118 | |
| 119 | if (filter) { |
| 120 | if (typeof filter === "function") { |
| 121 | parts.push(`filter()`); |
| 122 | } else { |
| 123 | parts.push(`filter({${Object.keys(filter).join(",")}})`); |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | if (sortConfig) { |
| 128 | parts.push(`sort()[${sortConfig.direction}]`); |
| 129 | } |
| 130 | |
| 131 | return parts.join("__"); |
| 132 | } |
| 133 | |
| 134 | const queryKeyBase = getQueryKeyBase(); |
| 135 | |