-
-
Notifications
You must be signed in to change notification settings - Fork 133
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-upload breaking node hooks #320
Comments
That's a confusing statement. How are React hooks relevant? I don't know what that "node hooks" stuff is about, but it sounds very fragile. It seems the sort of problems you are describing can be expected:
You can see how the graphql-upload/graphqlUploadExpress.js Lines 39 to 75 in b1cdd2a
The most hacky thing about it is this: graphql-upload/graphqlUploadExpress.js Lines 55 to 64 in b1cdd2a
So I would start there if you have considered everything else. |
Awesome. Thanks. |
Actually, I was misunderstanding the above. The express middleware is guaranteed to run before the gql middleware, no? I'll take a deeper look, but if it's alright, I'll leave this open for now, so I can put a fix here if I figure out what's going on. Node hooks docs: https://nodejs.org/api/async_hooks.html |
@James-Mnemosyne I'm still not sure what this issue is about. We only keep issues open in this project if it's something that I could action; what is it that you would like me to do to resolve this issue? |
Yeah. I haven't had time to dive into it, and probably won't for a bit. Sorry about that, and about the delay. Will close, but if there's a record of known issues, it might be worth jotting down somewhere that graphql-upload breaks node's hook functionality, even if it's only the high level incompatability that's apparent. |
@James-Mnemosyne My fork of |
Libraries using node hooks seem to be incapable of using node hooks.
In my case, in graphql middleware, I set an object in the node context and then fetch it:
E.g.
And in the middleware:
This works correctly for every request I have except for uploads.
What makes it stranger is that it only fails for larger uploads. 50kb files upload fine, but 500kb files fail. Both the setObject and getObject are only called once, no matter the size of the upload, and it's within a fraction of a second of each other (in fact, they occur within the same function call), which makes this a bit baffling, because in any case where getObject is called, setObject is guaranteed to have been called.
Is there some aspect of graphql upload that disables node hooks?
The text was updated successfully, but these errors were encountered: