-
Notifications
You must be signed in to change notification settings - Fork 7
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
Support sending operationName
#86
Comments
Hi @lynxtaa - is it possible to get this merged in the next couple months? If not I will have to figure out an alternative library/maintain a fork for now before I roll usage of this library into production - we currently rely on being able to see the operation name for monitoring performance of our queries |
Hi @onionhammer ! Thanks for the MR, I'll review it next week :) |
I have some troubles understanding why this feature is needed. The client doesn't need to send an |
Interesting, HotChocate server does not automatically extract that from the body of the query, I will do a little more research and get back to you tomorrow. |
Per the GraphQL Spec: https://spec.graphql.org/October2021/#GetOperation()
So it looks like as long as you send the operationName when multiple operations are being sent, this client should be good, otherwise it wont follow the spec |
Sorry for the delay @onionhammer . I see that we have two cases: 1. Single operation in a query In that case the 2. Multiple operations in a query In that case the |
The example I provided won't work 100% of the time, but the method in the pr would allow the user to put in the proper name of the operation As far as my needs go, I have been able to extract the operation name from the server (for single queries) |
That's great! Glad to hear it :) Thanks for bringing this issue. When writing this lib I didn't know that the spec allows multiple operations in the same query. I'll keep this issue opened, maybe I'll manage to add the support for it later |
OperationName is useful for logging purposes, frameworks like HotChocolate have a built-in field to handle it
Describe the solution you'd like
Pass operationName in the request payload
Describe alternatives you've considered
using a customFetch operation and extracting the operationName from the queries sent in
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: