Skip to content

Inherit and modify access / visibility on fields from ObjectType in InputType #876

Answered by MichalLytek
theseyi asked this question in Q&A
Discussion options

You must be logged in to vote

You should use the mixin-classes pattern.
This way you can declare the subparts of classes, like firstName and lastName, and then reuse them to compose input types and output types.

You can take a look at the example in the repo:
https://github.com/MichalLytek/type-graphql/tree/master/examples/mixin-classes

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@theseyi
Comment options

Answer selected by theseyi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants