-
Notifications
You must be signed in to change notification settings - Fork 12
Input Types generated incorrectly #53
Comments
Yes. Also, If you are interested in developing graphQL API with Prisma, you might want to check out nounandverb.io(It is a project that I am working on). This will generate proper graphQL schema and more. See this for details. Happy to help if you have any question about using nounandverb.io. |
+1 |
@yujong-lee thanks a lot for the info on DMMF, i'm looking into it right now. Currently in the above example you can see that an example payload of a relation DMMF looks like: {
name: 'Continent',
kind: 'object',
isList: false,
isRequired: false,
isUnique: false,
isId: false,
isReadOnly: false,
type: 'Continent',
hasDefaultValue: false,
relationName: 'ContinentToCountry',
relationFromFields: ['continentId'],
relationToFields: ['id'],
isGenerated: false,
isUpdatedAt: false,
}; What are your thoughts on changing the DMMF's with an relationToFields.length of |
@samrocksc You mean using Yes. I think that is the right approach. But one thing we should consider is that length of those fields can be greater than 1. // Example
model User {
id String @id @default(cuid())
name String
profile Profile?
@@unique([id, name])
}
model Profile {
id String @id @default(cuid())
user User @relation(fields: [firstName, lastName], references: [id, name])
firstName String
lastName String
@@unique([firstName, lastName])
} |
Is this package abandoned? Should Prisma remove it from their generators page? If this is depending on community support that it's not getting, it probably shouldn't be there. |
@eglove Yes. It is not being maintained right now. But I am not sure about whether it should be removed from the list or not.
|
Given the following Schema:
This generates the following schema:
The issue
We should be making the relation here on the
continentId
instead of theContinent
.The error created
The text was updated successfully, but these errors were encountered: