( queryFn: Resolver<TInput, TResult> | RpcClient<TInput, TResult>, )
| 79 | })() |
| 80 | |
| 81 | export const validateQueryFn = <TInput, TResult>( |
| 82 | queryFn: Resolver<TInput, TResult> | RpcClient<TInput, TResult>, |
| 83 | ) => { |
| 84 | if (isClient && !isRpcClient(queryFn) && isNotInUserTestEnvironment()) { |
| 85 | throw new Error( |
| 86 | `Either the file path to your resolver is incorrect (must be in a "queries" or "mutations" folder that isn't nested inside "pages" or "api") or you are trying to use Blitz's useQuery to fetch from third-party APIs (to do that, import useQuery directly from "@tanstack/react-query").`, |
| 87 | ) |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | const sanitize = |
| 92 | (type: ResolverType) => |
no test coverage detected