Skip to content

fix(server/http): graphql server compliance issues #4507

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

Merged
merged 26 commits into from
Jul 25, 2023

Conversation

YassinEldeeb
Copy link
Member

@YassinEldeeb YassinEldeeb commented Mar 30, 2023

closes #4037

image

@YassinEldeeb YassinEldeeb marked this pull request as ready for review April 18, 2023 11:36
@YassinEldeeb YassinEldeeb force-pushed the fix-compliance-issues-with-gql-server branch from 40b9611 to d4544f9 Compare June 5, 2023 22:54
@@ -229,15 +235,80 @@ where
/// Handles 404s.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment needs to be updated.

@leoyvens
Copy link
Collaborator

This would break any consumer which sends requests with a content-type or content-length. While that's reasonable and spec-compliant, I wouldn't want to roll this out without some switch to turn this off, in case any users report issues, so they have time to update their apps.

@YassinEldeeb YassinEldeeb force-pushed the fix-compliance-issues-with-gql-server branch from 4903e66 to ed01c1b Compare July 19, 2023 10:28
@YassinEldeeb
Copy link
Member Author

Hey @leoyvens, thanks for the feedback! Using the LESS_STRICT_GRAPHQL_COMPLIANCE environment variable will disable those checks.

@@ -7,14 +7,15 @@ use hyper::{header::ACCESS_CONTROL_ALLOW_ORIGIN, Body, Response};
pub fn assert_successful_response(
response: Response<Body>,
) -> serde_json::Map<String, serde_json::Value> {
assert_eq!(response.status(), StatusCode::OK);
// assert_eq!(response.status(), StatusCode::OK);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this commented out code be removed?

@@ -51,6 +52,7 @@ pub fn assert_error_response(
let json: serde_json::Value =
serde_json::from_str(&body).expect("GraphQL response is not valid JSON");

println!("{:?}", json);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the two println! in this file be removed?

@leoyvens
Copy link
Collaborator

Just two tiny comments before we can merge.

@YassinEldeeb
Copy link
Member Author

I've cleaned up the log and uncommented check

@leoyvens leoyvens merged commit e0d90c2 into master Jul 25, 2023
@leoyvens leoyvens deleted the fix-compliance-issues-with-gql-server branch July 25, 2023 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

graph-node compliance to the GraphQL over HTTP specification
2 participants