Open bglgwyng opened 2 years ago
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.
export type IsTypeOfResolverFn<T = {}, TContext = {}> = (
parent: {}, // prepended
obj: T,
context: TContext,
info: GraphQLResolveInfo
) => boolean | Promise<boolean>;
Is this the correct solution?
Hi!
Bit of an old issue but I'm also running into this when splitting my resolvers like above.
@PabloSzx Do you have an idea if this is a bug or intended behaviour?
Thanks! 🙏
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?