Adam
10/07/2020, 7:17 PMProject
that is related to an Organization
I would like to createOneProject
by just specifying teh organization ID but it generates as requiring the whole organization
object.
//Simplified
model Organization {
id Int @id @default(autoincrement())
name String?
projects Project[]
}
model Project {
id Int @id @default(autoincrement())
organization Organization @relation(fields: [organizationId], references: [id])
organizationId Int
name String
}
I'm using the experimentalCRUD
to generate createOneProject
but it auto generates with
type Mutation {
createOneProject(data: ProjectCreateInput!): Project!
}
Where
type Project {
id: Int!
name: String!
organizationId: Int!
}
input ProjectCreateInput {
name: String!
organization: OrganizationCreateOneWithoutProjectsInput!
}