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 then, the type check failed with this message.
Type '{ User: UserResolvers<MercuriusContext, User>; Query: QueryResolvers<MercuriusContext, {}>; Mutation: MutationResolvers<...>; }' is not assignable to type 'IResolvers<any, MercuriusContext>'.
Property 'User' is incompatible with index signature.
Type 'UserResolvers<MercuriusContext, User>' is not assignable to type 'GraphQLScalarType<unknown, unknown> | IEnumResolver | (() => any) | IResolverObject<any, MercuriusContext, any> | IResolverOptions<...> | undefined'.
Type 'UserResolvers<MercuriusContext, User>' is not assignable to type 'IResolverObject<any, MercuriusContext, any>'.
Property 'isTypeOf' is incompatible with index signature.
Type 'IsTypeOfResolverFn<User, MercuriusContext>' is not assignable to type 'IResolverObject<any, MercuriusContext, any> | IResolverOptions<any, MercuriusContext, any> | IFieldResolver<...> | undefined'.
Type 'IsTypeOfResolverFn<User, MercuriusContext>' is not assignable to type 'IFieldResolver<any, MercuriusContext, any>'.
Types of parameters 'info' and 'context' are incompatible.
Type 'MercuriusContext' is missing the following properties from type 'GraphQLResolveInfo': fieldName, fieldNodes, returnType, parentType, and 6 more.ts(2322)
When I switched UserResolvers to IResolvers["User"], the same message appeared.
How can I fix this problem?
The text was updated successfully, but these errors were encountered:
The error message above sounds like there is a mismatch of the position of context argument between IsTypeOfResolverFn and IFieldResolver.
So I added parent: {} to IsTypeOfResolverFn and the error got resolved.
Now my new IsTypeOfResolverFn definition reads as follows.
The following code passed type check. The definition of
IResolvers
is generated bymercurius-codegen
.I wanted to seperate the
User
resolver because it's quite large.But then, the type check failed with this message.
When I switched
UserResolvers
toIResolvers["User"]
, the same message appeared.How can I fix this problem?
The text was updated successfully, but these errors were encountered: