Relation doesn't exist on Type

prisma

#1

Hi, I have a schema that looks like:

type Class {
   id: ID!
   heroImage: File
   ...
}

type File {
  id: ID!
  public_id: String!
}

When I try to access the relation on my server (TypeScript GraphQL-Yoga) I get the following error:

Property 'heroImage' does not exist on type 'Class'.

The interface for class is missing all relations from my schema.

I’m trying to return an array of our latest classes.

How would I achieve something like the following?

    const myClass = await prisma.classes({
      id: "123"
    }).$fragment(`
     fragment ClassWithHeroImage on Class {
       title
       heroImage {
         public_id
       }
       duration
     }`);

    const hero = myClass.heroImage.public_id;