-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Behavior when querying subscription through incorrect protocol #1773
Comments
@stephentuso If your subscription root is reachable from query root then it's expected behavior. |
@IvanGoncharov Thanks, unless I'm misunderstanding, the query root isn't involved here so I don't think that applies. Let me clarify with a (contrived) example:
So, you can see the subscription type can be queried from Basically - should it be possible to query the subscription type with the |
@stephentuso Thanks for the example 👍 As I understand it's not a critical issue for your use case, but just a confusing behavior of |
Correct - I was trying out subscriptions, accidentally queried it through http, and was confused by the response. Not something that should be an issue in an actual app |
execute basically runs the executeSubscriptionEvent algorithm when it comes to subscriptions, and the graphql method just wraps execute, so this is known current behavior, if not obvious. When the execute and subscribe functions are eventually combined, the graphql method should probably be changed. |
See: #2144 |
For a subscription field,
resolve
is called with the source parameter set to whatever is yielded from thesubscribe
async iterator. However, I noticed that when a subscription field is queried from a server not usingsubscribe
, it behaves as if it is aquery
field;resolve
is called and the source parameter is set torootValue
.Is it supposed to even be possible to query
subscription
in that case? It seems like it would be appropriate to return an error there. Is this something that is expected to be handled outside of this library?The text was updated successfully, but these errors were encountered: