-
-
Notifications
You must be signed in to change notification settings - Fork 821
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
Schema stitching swallows original error stack traces from the children #743
Comments
@stringbeans have you tried retrieving the original error from like: err => err.originalError.errors ? |
@mfix22 yes i have... i actually was the one that fixed the issue originally but discovered that it didnt fix the case for sub-resolvers as described in the original description :( |
We've running into similar issues. Looks like for the sub schema there are 2 places where the stack got removed: |
I do have this same error currently, is there any workaround to mitigate this until fixed? |
Waiting for a workaround also... This is pretty pretty annoying. |
Any workaround found for this issue? |
Gonna try to fix this today! Starting to try to unpack the error handling stuff at the moment. |
@stubailo Hey Sashko! Just a background info: in my case I have a GraphQL microservice-based architecture and a gateway that merge all my schemas in front of the microservices which is my GraphQL exposed API. But in this merge step, the schema stiching swallows the original error so it's almost impossible to debug an error (no stack trace). |
This is where the error loses additional context, at least in my particular case: https://github.com/apollographql/graphql-tools/blob/master/src/stitching/errors.ts#L98-L108. I don't know enough about apollo-link-http and http-link-dataloader, but I think that comment only applies to the condition for is singular in length and hasResult, which So, there's the conceptual issue of trying to throw a singular error for multiple instances as a Can't the error instances just be returned as the |
I have the same Issue and I overcame it by using originalError object
|
@AdelBachene I had the same issue but my orignal error was nested deeper. |
Figured I'd chime in here. I'm running into the scenario where we're losing all errors and getting a message of We've got the following architecture:
So if our clients hit the
What's interesting is that if we provide I need to read more about how the format of those errors should be, but figured it was interesting enough to provide |
@dwelch2344 I've had the same experience. The cause is outlined in my issue dotansimha/graphql-binding#173 |
Just spent a good 4h trying to debug my custom link thinking that I was doing something wrong and not understanding why my error message is Is there any good workaround? I've ended up checking if the result has errors and if it does, then I do P.S.: My architecture is the exact same as @bazaglia and @dwelch2344 except I use a different transport/link. |
I can't get any of the solutions to work, seems bug is pretty important since it affects core schema stitching functionality (in my case basically stitching just a single schema is enough to swallow the exceptions within that one remote schema) |
@OlivierCuyp Nice, good use of the recursive function |
Seeing this as well, and it severely affects the development experience when using graphql with schema stitching. |
Here's a runnable reproduction that demonstrates this issue: I'm working on a fix now, and will have it ready shortly. |
I'm having issues similar to this, but it seems to depend on how deeply nested the error occurs within my schema stitched resolver. In example my graphql query could be like so |
Hi, I had the same issue. I managed to resolve it by using the workaround what @smber1 and @Pajk recommended in the threads:
Currently my introspection.ts looks like this: I've also had to format the error messages in the child nodes and the root node like this: |
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
No hope to get this sorted? ): |
Seems like this is only happening when there are multiple errors thrown in the resolvers. What is the ETA on this? Seems like multiple persons have tried to fix this but nothing has happened? |
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Solved this by switching to using graphql-tools-fork in our gateway until @yaacovCR's PR has been merged. Didn't need to change anything other than package.json and all the imports of graphql-tools, and worked like a charm. Thank's mate! |
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
I guess there's too much required work to provide a patch-package and the only actual solution as of now is to switch to graphql-tools-fork?
Really wanted to use |
#1206 is up to date on a separate forkPR branch I am maintaining. As it has not been merged for a while now, that likely does not change your main point, which is that the solution for right now seems to be to use the fork. :( Hopefully, the PR will be merged soon? |
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
Use new relocatedError function to update the original GraphQLErrors with the new path. Addresses ardatan#743, ardatan#1037, ardatan#1046, apollographql/apollo-server#1582.
We recently released an alpha version of GraphQL Tools (#1308) that should fix the issue. Please update
Let us know if it solves the problem, we're counting for your feedback! :) |
Rolled into #1306 |
This is related to the issue here: #480 and the (now accepted and closed) PR here: #637
The above PR unfortunately only fixes the case when there is an error thrown from a PARENT object in the response. so for example, if the query is something like:
HOWEVER, if there is an error thrown within a child field/object's resolver then graphql's schema stitching still swallows the error. example:
The text was updated successfully, but these errors were encountered: