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
I have been updating dependencies for a project and came up with an issue with TypeScript. Unfortunately the code below now results in TypeScript errors, specifically highlighting Mutation:
Property 'Mutation' of type '{ addPost(root: {}, args: AddPostArgs): Post; }' is not assignable to string index type '(() => any) | GraphQLScalarType | IEnumResolver | IResolverObject<any, any>'.
If I remove the second args argument from addPost or cast it to something like {}, any, or {[x: string]: any} then it does not complain, but then I lose my typings with my implementation. Apparently it does not like it when I use AddPostArgs for args now? There was no issue with it before. Even if I change AddPostArgs to an interface or inline the type ({title: string, description: string}) it still does not work.
EDIT: Upon further examination, it does seem it's an issue with args:
I have been updating dependencies for a project and came up with an issue with TypeScript. Unfortunately the code below now results in TypeScript errors, specifically highlighting
Mutation
:I get a type error under
Mutation
:If I remove the second
args
argument fromaddPost
or cast it to something like{}
,any
, or{[x: string]: any}
then it does not complain, but then I lose my typings with my implementation. Apparently it does not like it when I useAddPostArgs
forargs
now? There was no issue with it before. Even if I changeAddPostArgs
to an interface or inline the type ({title: string, description: string}
) it still does not work.EDIT: Upon further examination, it does seem it's an issue with
args
:EDIT 2: May have something to do with TypeScript's
strictFunctionTypes
, which is enabled when I havestrict: true
fortsconfig.json
.The text was updated successfully, but these errors were encountered: