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
The official graphql-js document refers that GraphQLNonNull is a class so if I want to use it I have to instantiate it and then pass a valid graphql type to it
But when I do that the IDE that I use (WebStorm) show me a warning about that:
Interface can not be instantiated
However, the warning disappears when I use it without instantiating it (without writing new keyword before it)
This is intentional: the types are interfaces, and GraphQLNonNull(ofType) is a method to get you a concrete instance of the GraphQLNonNull. This for instance helps prevent usages of instanceof that have caused issues in the past.
The official graphql-js document refers that GraphQLNonNull is a class so if I want to use it I have to instantiate it and then pass a valid graphql type to it
But when I do that the IDE that I use (WebStorm) show me a warning about that:
However, the warning disappears when I use it without instantiating it (without writing
new
keyword before it)This problem is also happening with GraphQLList
The text was updated successfully, but these errors were encountered: