You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But with TS strictNullChecks enabled, it results in an error.
The fix in the PR was to use some graphql types that used "Maybe" synthax to allow for the null return type, but it looks like the types of the graphql module have changed since then and don't include "Maybe" in the return type anymore, resulting in the same type issue reappearing.
Is there an existing issue for this?
Current behavior
The issue is basically the same as this one: #222
That was previously fixed in this PR: #749
The sample code in the docs for the parseLiteral method of custom scalar is this:
But with TS strictNullChecks enabled, it results in an error.
The fix in the PR was to use some graphql types that used "Maybe" synthax to allow for the null return type, but it looks like the types of the graphql module have changed since then and don't include "Maybe" in the return type anymore, resulting in the same type issue reappearing.
Minimum reproduction code
https://github.com/nestjs/nest/blob/master/sample/12-graphql-schema-first/src/common/scalars/date.scalar.ts
Steps to reproduce
No response
Expected behavior
CustomScalar should allow parseLiteral to return null or undefined as demonstrated by the samples.
Package version
12.0.4
Graphql version
graphql
: "^16.7.1",@apollo/server
: "^4.7.5",NestJS version
10.0.3
Node.js version
18.17.1
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: