Best Practice and Efficient way #4033
Replies: 1 comment
-
check out the answer here With partial classes nothing special is happening behind the scenes as it's just a regular C# feature. It's downsides are that it can not be uses across assemblies and you can't replace or remove fields that where defined in another partial class. Type extensions on the other hand are being merged with the original type definition by HotChocolate. They work across assemblies and allow you to hide or replace members of the original type definition. As you've quoted from the documentation, partial classes are easier to use if you just want to split your type definitions into different files within the same project. For a more Hot Chocolate integrated way of combining these multiple files (classes) Type Extensions should be used. |
Beta Was this translation helpful? Give feedback.
-
which one is best and efficient way to organize query, mutation and subscription class?
And what is the difference, what is happening behind the scenes?
In this official docs
If we just want to organize the fields of one of our types in different files, we can use partial classes in the Annotation-based approach.
But in workshop ExtendObjectType is used
Beta Was this translation helpful? Give feedback.
All reactions