4

in my data model, as the type of id, I want to generate a default value that will start with the user.

so the id will bed something like this user..rear33422qeqr

type User {

  myId: String! @default (`user${2+2}`)
  name: String!
  email: String! @unique

}

is it possible to call a javascript function or using string interpolation (user${2+2})

Ashik
  • 2,014
  • 4
  • 21
  • 40
  • Frankly, I didn't understand what you want to do, do you want to generate a random string and append it to your user? – SMAKSS May 04 '20 at 04:50
  • 1
    I want to customize the auto generated prisma id. by default all id starts with ck... for example this is a valid prisma id , which is auto generated. `ck9rni8rv001507190wwmatgy` but I want to customize this. so that all user's id will be `user--randomDigit/randomString` and all post's id will be `posts--randomDigit/randomString` – Ashik May 04 '20 at 05:00

0 Answers0