paljs / prisma-tools

Prisma tools to help you generate CRUD system for GraphQL servers
https://paljs.com
MIT License
683 stars 54 forks source link

Problem with gql generation when using the following scalar array type #181

Closed gtolarc closed 3 years ago

gtolarc commented 3 years ago

There seems to be a problem with gql generation when using the following scalar array type. Creation works fine, but an error occurs when receiving gql input.

model Option {
  id          Int         @default(autoincrement()) @id
  name        String
  list        String[] // <- this

  active      Boolean     @default(true)
  note        String?
  createdAt   DateTime    @default(now())
  updatedAt   DateTime    @updatedAt
}

The following is a request from PrismaTable. 스크린샷 2021-02-16 오전 10 24 55

{ "errors":[{"message":"Variable \"$data\" got invalid value [\"10\", \" 20\"] at \"data.list.set\"; String cannot represent a non string value: [\"10\", \" 20\"]",

The following is the schema. 스크린샷 2021-02-16 오전 10 29 09 It seems that the schema creation is not supposed to receive an array. I don't know if it's a bug in the paljs generator or nexus, can you check it? @AhmedElywa