Closed raymclee closed 3 years ago
the output from the console.log(select) is { select: { id: true, phone: true, owner: { select: [Object] } } }.
use console.dir(select, {depth: null})
to see owner: { select: [Object] } }
details
the output from the console.log(select) is { select: { id: true, phone: true, owner: { select: [Object] } } }.
use
console.dir(select, {depth: null})
to seeowner: { select: [Object] } }
details
please see the output
{
select: {
id: true,
phone: true,
owner: { select: { id: true, email: true } }
}
}
prisma:query SELECT 1
prisma:info Fetched a connection from the pool
prisma:query SELECT "dev"."shops"."id", "dev"."shops"."phone", "dev"."shops"."owner_id" FROM "dev"."shops" WHERE 1=1 OFFSET $1
prisma:info Fetched a connection from the pool
prisma:query SELECT "dev"."shops"."id", "dev"."shops"."owner_id" FROM "dev"."shops" WHERE "dev"."shops"."id" IN ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28,$29,$30,$31,$32,$33,$34,$35,$36,$37,$38,$39,$40,$41,$42,$43,$44,$45,$46,$47,$48,$49,$50) OFFSET $51
My tool is working fine and converted
{
shops {
id
phone
owner {
id
email
}
}
}
to
{
select: {
id: true,
phone: true,
owner: { select: { id: true, email: true } }
}
}
oh sorry, my database got screwed up. i forgot to add the relationship. after i add back the relationship and it works perfectly! Thanks
I have the following code in resolver.
"prisma": "2.21.2", "@paljs/plugins": "^3.0.1",
and when i use above query. the field from owner are not returning. the output from the console.log(select) is { select: { id: true, phone: true, owner: { select: [Object] } } }. below is the prisma log. as you can see, prisma is not selecting the column in owner