hydra
hydra copied to clipboard
Input schema's incorrect relation optionality
The following input schema:
type Book {
library: Library!
...
}
type Library @entity {
books: [Book!]! @derivedFrom(field: "library")
...
}
incorrectly generates property as optional in library.model.d.ts
:
export declare class Library extends BaseModel {
books?: Book[]; // this should be required property, but it's optional
...
}
The similar issue seems to occur with variant's single relation:
type MyVariant @variant {
book: Book!
}
// generating model
export declare class MyVariant {
book?: Book;
...
}