Why is defining a constructor on @ObjectType class forbidden? #1201
Unanswered
maclockard
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Because object instances are created multiple times in the pipeline and are called without any arguments. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The docs call out the fact that defining a constructor on an object type is forbidden:
source
However, I'm not sure I really understand why? I've used constructors for some
@ObjectType
classes and it didn't seem to have an affect.Additionally, it seems like using a constructor for union types is encouraged: #1179 (comment)
Beta Was this translation helpful? Give feedback.
All reactions