X_QUERY_FOREIGN
Means
a value that is not a query was projected as one
Typical cause
a hand-rolled object with kind: 'query', or a query from a duplicated copy of @ultimat3/query
Fix
declare it as export const name = query({ input, policy, sql })