-
Notifications
You must be signed in to change notification settings - Fork 57
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
Issue when returning Union (Abstract type) #90
Comments
I believe this to be a duplicate of #69. While resolving the type a promise is returned and this is not handled cleanly. As a starter we can return a proper error message instead of this confusing message. |
Hello @ruiaraujo, thanks for your reply. I agree with you, a proper error message would definitely be more helpful! |
The type has changed, but the behaviour is most likely the same. |
Same issue as above. I used https://github.com/zalando-incubator/graphql-jit/blob/master/examples/blog-apollo-server/src/executor.ts and saw our union types not working anymore. Maybe worthwile to add it to the docs that the async usecase is also not being supported with async TypeResolvers? Since the example and readme made me think i shouldnt expect problems because im not using Im using I will debug little further, since it doesnt happen in the example when i make stuff async and introduce Union type there https://github.com/maapteh/graphql-jit/tree/bug/union-types/examples/blog-apollo-server branches:
So in my case its But GraphQLTypeResolver can be Value or Promise according to graphql-js specs so the main issue should not happen in my opinion. Do you consider fixing this? Btw i like the effort to make Apollo faster, in our case it was 2x but still Apollo seems to be the worst performant one so every addition to make it faster is nice to have. So your library is very promising. |
We are also facing this issue and unfortunately it is a blocker for us( we are not using type-graphql. |
Hi, it would be great to address this issue if it is spec-compliant. Would you accept a PR? |
So, I am using
type-graphql
withexpress-graphql
andgraphql-jit
.Here is how I use
graphql-jit
withinexpress-graphql
:At first everything works fine before I add a query that returns a
Union
type but the moment I use a query that returns a Union, I get the error below:This error only manifests when a mutation/query returns a Union. Other than that every mutation/query works just fine. when I disable
graphql-jit
(by commenting thecustomExecuteFn
), everything works fine.BTW, thanks for this awesome lib ❤️
The text was updated successfully, but these errors were encountered: