```model BrandCategory { id String @id ti...
# prisma-client
g
Copy code
model BrandCategory {
  id     String  @id
  title  String
  hero   String?
  brands Brand[]
}
Copy code
const BrandCategory = objectType({
  name: "BrandCategory",
  definition(t) {
    t.string("id");
    t.string("title");
    t.string("hero", {
      nullable: true,
    });
    t.list.field("brands", {
      type: "Brand",
      resolve: (parent) =>
        prisma.brandCategory
          .findOne({
            where: { id: String(parent.id) },
          })
          .brands(),
    });
  },
});
Hi all - i'm getting typescript errors on my relational BrandCategory <-> Brand object. ANy idea what I need to do to handle this PromiseLike / MaybePromise issue?
Copy code
Type 'Promise<Brand[]>' is not assignable to type 'PromiseLike<{...}>
Copy code
Type 'Promise<Brand[]>' is not assignable to type 'MaybePromise<{...}>
j
It looks to me that your forgot to add
await
to
prisma.brandCategory....
g
hmmm, let me check