-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
WrapFields Incompatibility with Subscriptions #2282
Comments
Thanks for pointing out. Definitely a bug. |
Minimal reproduction in form of PR with failing test or separate repo would be extremely helpful |
Related: graphql/graphql-js#2861 |
Related: graphql/graphql-spec#776 |
are you able to confirm working with the alpha versions in linked PR: #2292 (comment) |
thanks again for reporting! |
I'll take a look first thing tomorrow morning, thank you as usual for quickly fixing what I assume are really obscure bugs. |
Was this if statement supposed to be: if (
(this.subscriptionTypeName && parentTypeName !== this.subscriptionTypeName)
&& (this.dataTransformer != null || this.errorsTransformer != null)
) { As-is, it doesn't work because (I'll be honest that I don't fully understand this code still, so I might be misinterpreting what this statement is supposed to do.) Thank you again for your help with this! |
Yes, that was it, seems I had speed over accuracy/tests on this one. But if you are able to submit PR I can merge |
Will do. I am troubleshooting another issue which I don't think is related, but I want to confirm that first. |
In terms of what the code is doing, we are annotating every object with type name in order to get a fully type result.... That way we can traverse the results and unwrap fields as necessary no matter how nested deeply they are.... With this work around, we assume that if type name is not available it is because it is The root subscription type which is impossible to annotate with type name |
Thank you! The issue I was debugging was just from upgrading from graphql-tools 6 to 7. Submitted the PR here: #2299 And thank you for the help in understanding this! For the past 5 years my main job has not been as a developer (I work for a tech education nonprofit), but I hope to actually read the GraphQL spec over the winter holidays so I can understand more about how this all works. |
Second attempt has been released! |
Working for me! Thank you once again! :) |
It seems like adding a
WrapFields
transform to a schema causes all emitted queries to include the following root selection:This causes all subscriptions to fail (because of the restriction against having more than one root field in a subscription). This is true even though the
WrapFields
transform isn't wrapping anything related to a Subscription.Am I doing something totally wrong here, or is there a known way around this? If it's a new bug I can try to come up with a stand-alone reproduction.
The text was updated successfully, but these errors were encountered: