Sdl graphql typing

The sdl file is having typing error.

My schema:

model User {
  id                  Int         @id @default(autoincrement())
  email               String      @unique
  roles               UserRoles[]
  hashedPassword      String
  salt                String
  resetToken          String?
  resetTokenExpiresAt DateTime?
  createdAt           DateTime    @default(now())
  createdBy           Int?
  creator             User?       @relation("Creator", fields: [createdBy], references: [id])
  updatedAt           DateTime?   @updatedAt
  updatedBy           Int?
  updater             User?       @relation("Updater", fields: [updatedBy], references: [id])
  categoryCreator     Category[]  @relation("CategoryCreator")
  categoryUpdater     Category[]  @relation("CategoryUpdater")
}


model Category {
  id               Int        @id @default(autoincrement())
  name             String     @unique
  imageId          Int?
  image            Image?     @relation(fields: [imageId], references: [id])
  parentCategoryId Int?
  parentCategory   Category?  @relation("ParentSubCategories", fields: [parentCategoryId], references: [id])
  subCategories    Category[] @relation("ParentSubCategories")
  createdAt        DateTime   @default(now())
  createdBy        Int?
  creator          User?      @relation("CategoryCreator", fields: [createdBy], references: [id])
  updatedAt        DateTime   @default(now()) @updatedAt
  updatedBy        Int?
  updater          User?      @relation("CategoryUpdater", fields: [updatedBy], references: [id])
}

My sdl:

export const schema = gql`
  type Category {
    id: Int!
    name: String!
    imageId: Int
    image: Image
    parentCategoryId: Int
    parentCategory: Category
    subCategories: [Category]!
    createdAt: DateTime!
    createdBy: Int
    creator: User
    updatedAt: DateTime!
    updatedBy: Int
    updater: User
  }
...
...`

The error:

Must be somewhere I did wrongly, hopefully someone can point it out for me.

Hi @thomas looks like you’re missing your user sdl!

yarn rw g sdl User

Should do the trick! :v:t4:

I tried generate the sdl User, also regenerate the sdl Category with yarn rw g sdl category --force. But the error still remain.