-
-
Notifications
You must be signed in to change notification settings - Fork 676
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
Overriding properties in subclass for InputType does not work correctly. #1109
Comments
First of all, you should not do Secondly, instead of a weird inheritance chain, you should use generic types and pass the enhanced inputs as arguments instead of overwriting the properties. It makes things much more maintainable and understandable. However, I've managed to reproduce your issue about provided data not showing up in the injected object. Will take a look at that and try to fix it 😉 |
Hi - wauw, you have the fastest response time ever! Thanks!
As I'm new to the whole NodeJS/Graphql world (long time Java/.Net/python) developer here, can you tell me why I should not provide default arguments? Or is there another way?
I agree, still in the walking skeleton phase and did not think of it yet.
You are a hero! |
It makes no sense in your case. The default for |
Fixed in 3ac1a27, will be released in RC2 🔒 |
Describe the Bug
First of all, thanks for this great project!
I'm experiencing a bug when creating a subclass for an InputType where one overrides properties with subclasses (I know - a lot of inheritance 😄 ). The resulting schema is generated correctly but when calling the query, data is not available in the resolver.
To Reproduce
class
QueryArgs.ts
class
ProductQueryArgs
In the resolver:
Output of
console.log
:The schema is generated correctly but when I pass data for
sorting
, it is not available in thepmdQueryArgs
. If I remove the inheritance (extends QueryArgs
) and add thepagination
property inProductMasterDataQueryArgs
, all is well. The output ofconsole.log
is then:Expected Behavior
I expect the same logging in both cases.
Logs
See above
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: