-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
graphql-modules-preset is not adding interface and union resolvers to Module.Resolver #7123
Comments
Is there a way to fix/work around this? union MyUnion = InterfaceImpl1 | InterfaceImpl2 | InterfaceImpl3
interface MyInterface{
id: String!
}
type InterfaceImpl1 implements MyInterface{
id: String!
...
}
type InterfaceImpl2 implements MyInterface{
id: String!
...
}
type InterfaceImpl3 implements MyInterface{
id: String!
...
}
Same when only using Unions. |
HI @the-ult, the workaround we've used was to define each type (
instead of having one Also, we've stopped using union and the result types are using the base interface (eg.
Hope it helps. |
Thanks gonna try it out tomorrow. Would be great though, if this could be fixed/added to the |
@dotansimha is this issue a I used to fix 🤔 it like this: export const PersonResolvers: PersonModule.Resolvers | unknown = {} But that way you'll lose all Typings.. 😳 Was trying it now like this:
Not much better, but at least this way we keep the types of all other Gonna try @laurent-lubino-roam way today. |
Describe the bug
When using graphql-module framework, the generated resolver is missing definition for interfaces and unions.
To Reproduce
Steps to reproduce the behavior:
Repo that reproduce the issue with readme for explanantion
https://github.com/laurent-lubino-roam/graphql-modules-codegen-resolver
Expected behavior
I would expect to be able to resolve types directly in the resolver using
resolveType
instead ofisTypeOf
Environment:
@graphql-codegen/graphql-module-preset
:Additional context
The text was updated successfully, but these errors were encountered: