Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input schema's incorrect relation optionality #462

Open
ondratra opened this issue Oct 4, 2021 · 0 comments
Open

Input schema's incorrect relation optionality #462

ondratra opened this issue Oct 4, 2021 · 0 comments
Assignees
Labels
bug Something isn't working low-prio

Comments

@ondratra
Copy link
Contributor

ondratra commented Oct 4, 2021

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;
  ...
}
@ondratra ondratra added the bug Something isn't working label Oct 4, 2021
@ondratra ondratra self-assigned this Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low-prio
Projects
None yet
Development

No branches or pull requests

2 participants