-
Notifications
You must be signed in to change notification settings - Fork 257
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
Add operationName variable for health_check_query #837
Conversation
@kutysam: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
I've signed the agreement.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've suggested we stick to the exact operation name with the double underscore convention.
Otherwise, LGTM! Can you please add an entry to gateway-js/CHANGELOG.md
?
gateway-js/src/index.ts
Outdated
@@ -119,6 +119,7 @@ export const GCS_RETRY_COUNT = 5; | |||
|
|||
export const HEALTH_CHECK_QUERY = | |||
'query __ApolloServiceHealthCheck__ { __typename }'; | |||
export const HEALTH_CHECK_QUERY_OPERATION_NAME = 'ApolloServiceHealthCheck'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export const HEALTH_CHECK_QUERY_OPERATION_NAME = 'ApolloServiceHealthCheck'; | |
export const HEALTH_CHECK_QUERY_OPERATION_NAME = '__ApolloServiceHealthCheck__'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really necessary? See my comment: #835 (comment)
If we suddenly have a pressing need to go above and beyond the standard GraphQL-over-HTTP protocol and always include operationName even when there's just one operation, then this would just be the tip of the iceberg. I'm sure there are hundreds of places across Apollo open source projects where we would need to make a similar change.
Fixes #835
There is another issue that is slightly related #768 but the code is standalone for healthcheckquery, thus I am fixing this just for health check.
This is the payload for the data being sent by apollographql healthcheck and it is missing operationName
![image](https://user-images.githubusercontent.com/1703663/123407899-0b5d0180-d5df-11eb-8e32-5ac4b2230234.png)
Why do we need this?
gql.operation.name
in netflix dgs framework metrics https://netflix.github.io/dgs/advanced/instrumentation/#shared-tagsThese images show the payload within graphiql
![image](https://user-images.githubusercontent.com/1703663/123406934-021f6500-d5de-11eb-81a2-fffb9fa1ed57.png)
![image](https://user-images.githubusercontent.com/1703663/123407028-17948f00-d5de-11eb-89aa-1c19dc1da3f7.png)