| 244 | |
| 245 | /** Public read, works logged out. Null means the id is unknown. */ |
| 246 | export const picksQueryOptions = (id: string) => ({ |
| 247 | queryKey: generateQueryKey(RequestKey.Picks, undefined, id), |
| 248 | queryFn: async (): Promise<Picks | null> => { |
| 249 | const data = await gqlClient.request<{ picks: Picks | null }>(PICKS_QUERY, { |
| 250 | id, |
| 251 | }); |
| 252 | return data.picks ?? null; |
| 253 | }, |
| 254 | }); |
| 255 | |
| 256 | export const myCurrentPicksQueryOptions = (user?: Pick<LoggedUser, 'id'>) => ({ |
| 257 | queryKey: generateQueryKey(RequestKey.Picks, user, 'current'), |