graphql-js
graphql-js copied to clipboard
Remove maybe types
Optional arguments and parameters should not use the maybe type except where passing in a null value is semantically different from passing in an undefined value. So
operationName?: ?string
would become just
operationName?: string,
@danielrearden Thanks 👍 Also, there is some background in this comment: https://github.com/graphql/express-graphql/pull/622#issuecomment-640920054
@IvanGoncharov you mean to remove undefined from Maybe type?
@IvanGoncharov you mean to remove undefined from Maybe type?
The general idea does not require modification of Maybe but closer inspection as to where and how it is used. Optional arguments and parameters should not generally accept null with strict TS and so Maybe as currently defined should not be user, null is wrong, and you get undefined for free by labeling the argument as optional.