DT
Drizzle Team•2y ago
Amur

Including more than 1 relation in query throws error

If i try to include more than 1 relation i get an error 👇
{
"errorMessage": "could not identify an equality operator for type json",
"errorType": "Hw",
"stackTrace": [
"error: could not identify an equality operator for type json",
" at /serverless-app/eosw-ts/.esbuild/.build/eosw/api/edition.js:2:12873",
" at processTicksAndRejections (node:internal/process/task_queues:96:5)",
" at async /serverless-app/eosw-ts/.esbuild/.build/eosw/api/edition.js:59:42969",
" at async EQe (/serverless-app/eosw-ts/.esbuild/.build/eosw/api/edition.js:59:63260)"
]
}
{
"errorMessage": "could not identify an equality operator for type json",
"errorType": "Hw",
"stackTrace": [
"error: could not identify an equality operator for type json",
" at /serverless-app/eosw-ts/.esbuild/.build/eosw/api/edition.js:2:12873",
" at processTicksAndRejections (node:internal/process/task_queues:96:5)",
" at async /serverless-app/eosw-ts/.esbuild/.build/eosw/api/edition.js:59:42969",
" at async EQe (/serverless-app/eosw-ts/.esbuild/.build/eosw/api/edition.js:59:63260)"
]
}
This is the query 👇
await db.query.magazines.findFirst({
where: eq(magazines.id, "faa66220-0165-48f6-9895-afdab22d160d"),
with: {
editions: true,
publisher: true,
},
});
await db.query.magazines.findFirst({
where: eq(magazines.id, "faa66220-0165-48f6-9895-afdab22d160d"),
with: {
editions: true,
publisher: true,
},
});
If i remove either editions: true or publisher: true then it works
1 Reply
Amur
AmurOP•2y ago
changing my json fields to jsonb solved the issue
Want results from more Discord servers?
Add your server