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
Fix UnhandledError when resolving top-level subscription field #3568
Conversation
How about this? var inner = field.Resolver ?? ((field.StreamResolver != null) ? SourceFieldResolver.Instance : NameFieldResolver.Instance)); |
I believe the schema-first and auto-registering code both set the Resolver property correctly. It is only code-first that would have an issue. Now, it is not mandatory that the SourceFieldResolver is used. The event data from the IObservable is passed in as the root value at SubscriptionExecutionStrategy.cs:182. However, setting a custom resolver could apply a transform to this data. It is much more intuitive to apply the transform to the IObservable, and as far as I know this is how subscriptions are typically used. NameFieldResolver would never be used. Also if we look at the Also within those same two methods, note that the |
We could add |
Thanks. I would like to publish v7.3.1, OK? |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #3568 +/- ##
==========================================
- Coverage 83.83% 83.83% -0.01%
==========================================
Files 381 381
Lines 16840 16839 -1
Branches 2697 2697
==========================================
- Hits 14118 14117 -1
Misses 2076 2076
Partials 646 646
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Sure |
Also see #3213
Yesterday one of our team members found a bug when using field middleware and calling subscription.
Before fix:
ApplyMiddleware
method setsNameFieldResolver.Instance
for all fields, even for subscriptions. I have no ideas why we haven't found it before.@Shane32 I need your help. I do not like current implementation. The main problem is
complex == schema?.Subscription
comparison.SchemaTypes
has no reference to schema but in fact onlySchema
calls all methods onSchemaTypes
, so I just added two methods and delegated work to them. I would like to change design - either adding reference toSchema
or in some other way.