Adding Permissions in User causes splicing error?


#1

When I try to add a permission to a user on the Prisma dashboard using the add item selection, I get an error added any type of permission to the user permissions property (an array)

here is my data model

enum Permission {
  ADMIN
  USER
  ITEMCREATE
  ITEMUPDATE
  ITEMDELETE
  PERMISSIONUPDATE
}

type User {
  id: ID! @id
  name: String!
  email: String! @unique
  password: String!
  resetToken: String
  resetTokenExpiry: Float
  permissions: [Permission] npm 
  cart: [CartItem!]!
}

type Item {
  id: ID! @id
  title: String!
  description: String!
  image: String
  largeImage: String
  price: Int!
  user: User!
  createdAt: DateTime! @createdAt
  updatedAt: DateTime! @updatedAt
}

type CartItem {
  id: ID! @id
  quantity: Int! @default(value: 1)
  item: Item # relationship to Item
  user: User! # relationship to User
}

type OrderItem {
  id: ID! @id
  title: String!
  description: String!
  image: String!
  largeImage: String!
  price: Int!
  quantity: Int! @default(value: 1)
  user: User
}

type Order {
  id: ID! @id
  items: [OrderItem!]!
  total: Int!
  user: User!
  charge: String!
  createdAt: DateTime! @createdAt
  updatedAt: DateTime! @updatedAt
}

The splicing error in the console is this


#2

Answering my own question to help you Wesbos Advanced React course folks out there

add permissions into your query, scroll to permissions, clip the elipses and add the permissions from there and it will work