-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[typescript-resolvers] avoid input optional as typescript-operations #3815
Comments
I think it will have to use a different controls, right? What did you have in mind? @LucienLee |
I think that it could be the same because we can pass options in the output level (usually, resolvers and operations will be generated in the different files) and plugin level. It' doesn't matter we used the same config signatures. However, maybe we can have a new one setting, BTW, I think the documentation of avoidOptionals is not quite completed now. People cannot know what is the setting meaning. |
@dotansimha any thoughts? |
@LucienLee I think you are right. PRs are welcome ;) |
Fwiw if you're messing with
I.e. if I'm not mapping a type, I don't need a resolver for it, b/c I'll just instantiate it fully each time I want to return it. And when I instantiate it, I should have to specify all of the fields. If I am mapping a type, then I need a resolver for it, and every field in that resolver should be required (imo/at least as a potential config option). We ended up implementing our own version of |
@stephenh maybe this is something you can share with us? This use case sounds interesting, maybe it could help others as well :) |
@dotansimha sure :-) here's our plugin's repo: https://github.com/homebound-team/graphql-typescript-simple-resolvers (also edited my original suggestion for clarity) |
Now, we have dedicated controls of optional types in typescript-operations, including
field
,inputValue
andObject
. However, we only can choose on or off in typescript-resolvers.I suggest that typescript-resolvers can take
avoidOptionals
as typescript-operations.The text was updated successfully, but these errors were encountered: