- 
                Notifications
    
You must be signed in to change notification settings  - Fork 123
 
Open
Description
Describe the Bug
When trying to set(https://www.prisma.io/docs/orm/reference/prisma-client-reference#set) posts of the user via generated graphql, schema has invalid types for fields in set
To Reproduce
Imagine this schema:
datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}
generator client {
  provider = "prisma-client-js"
}
generator typegraphql {
  provider = "typegraphql-prisma"
}
model User {
 id Int     @id @default(autoincrement())
 name String
 posts Post[]
}
model Post {
 id Int     @id @default(autoincrement())
 name String
 user   User @relation(fields: [userId], references: [id])
 userId Int
}then with prisma you can do something like this:
prisma.user.update({
  where: { id: 1 },
  data: { posts: { set: [{ id: 1, name: "hello" }, { name: "world" }] } },
});But typegraphql prisma generates graphql schema so that query looks like this:
mutation {
  updateOneUser(
    where: {id: 1}
    data: {posts: {set: [{name: {equals: "why operators here???"}}]}}
  ) {
    id
  }
}Which is not logical at all. name property should be just a string and not a object with operators from where clause.
Expected Behavior
properties inside set should be raw values and not objects with operators properties
Environment (please complete the following information):
typegraphql-prismaversion 0.28.0
Metadata
Metadata
Assignees
Labels
No labels