-
|
So I am having trouble making my resolvers work with my services/controllers that connect to my database with mongoose. And I understand the error in Typescript but what if I don't want to the field to be nullable, just undefined. Here for example This is my updateExperience that calls that interface This is my updateExperience graphql function So when I call my function in my resolver i get the error above. I guess I could add "| null" to the IUpdateExperience, but I dont want the users to be able to update the title to null. If the title is undefined I am not updating the title. Now in some cases I didnt have the problem above I dont know why. Is there a procedure to avoid this errors. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
@jdc18 You can change |
Beta Was this translation helpful? Give feedback.
-
Is there a way to do that in client-preset? |
Beta Was this translation helpful? Give feedback.
@jdc18 You can change
maybeValuein configuration;https://graphql-code-generator.com/docs/plugins/typescript
By default it is
T | nullso you can change it toTonly.