aliabbasrizvi
aliabbasrizvi
PPrisma
Created by aliabbasrizvi on 7/3/2024 in #help-and-questions
Problem with nested create
Hi I have a table that has 2 relationships with a different table. When I try to do a nested create it fails saying it requires docGenerationId Isn't it implied already? The create command:
const docGeneration = await prisma.docGeneration.create({
data: {
id,
user: {
connect: { id: user.id },
},
workspace: {
connect: { id: workspaceId },
},
draftInput: {
create: {
id: inputId,
settings,
},
},
},
})
const docGeneration = await prisma.docGeneration.create({
data: {
id,
user: {
connect: { id: user.id },
},
workspace: {
connect: { id: workspaceId },
},
draftInput: {
create: {
id: inputId,
settings,
},
},
},
})
2 replies
PPrisma
Created by aliabbasrizvi on 7/3/2024 in #help-and-questions
Can I opt into join vs every query being join by default?
Hi I am looking to try the relationJoins feature, but looks like enabling it enables it for all queries and then you have the option to opt out of it. Is there a configuration where I can control the default behavior (I'd like to leave it as query) and then slowly opt into join for some queries?
6 replies