Skip to content
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

graph-node compliance to the GraphQL over HTTP specification #4037

Closed
dotansimha opened this issue Oct 6, 2022 · 0 comments · Fixed by #4507
Closed

graph-node compliance to the GraphQL over HTTP specification #4037

dotansimha opened this issue Oct 6, 2022 · 0 comments · Fixed by #4507
Assignees
Labels
area/graphql enhancement New feature or request

Comments

@dotansimha
Copy link
Contributor

dotansimha commented Oct 6, 2022

As part of the work done in the GraphQL Foundation, there is an active working group for defining how to run GraphQL over HTTP. This working group was working in the past 2 years to build a specification that is intended to fill this gap by specifying how GraphQL should be served over HTTP.
The main intention of this specification is to provide interoperability between different client libraries, tools and server implementations.

You can find the latest specification here

As part of @enisdenjo's work on this working group, they created a list of requirements, and a tool to audit and generate a compliant report.

You can find the report for graph-node here: https://github.com/enisdenjo/graphql-http/blob/master/implementations/thegraph/README.md and here's a list of issues that worth fixing soon:

  1. MUST accept application/json and match the content-type
Content-Type header "text/html" does not contain "application/json"
  1. MUST use utf-8 encoding when responding
Body is not UTF-8 encoded
  1. MUST accept only utf-8 charset
Content-Type text/html status code 200 is not greater than or equal to 400
  1. MUST accept POST requests
Status code 404 is not 200
  1. MUST NOT allow executing mutations on GET requests
Status code 200 is not 405
  1. MUST accept application/json POST requests
Status code 404 is not 200
  1. MUST require a request body on POST
Status code 404 is not 400
  1. MUST allow string {query} parameter when accepting application/json
Status code 404 is not 200
  1. MUST allow string {operationName} parameter when accepting application/json
Status code 404 is not 200
  1. MUST allow map {variables} parameter when accepting application/json
Status code 404 is not 200
  1. MUST allow URL-encoded JSON string {variables} parameter in GETs when accepting application/json
Response body is not valid JSON. Got "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\" />\n<title>The GraphiQL</title>\n<script src=\"/cdn-cgi/apps/head/a-7iaLT0SRdb_kvxGKIYLrjkGzU.js\"></script><style>\n      .graphiql-container,\n      .graphiql-container button,\n      .graphiql-container input {\n        color: #141823;\n        font-family: system, -apple-system, San Francisco,\n          \".SFNSDisplay-Regular\", Segoe UI, Segoe, Segoe WP, Helvetica Neue,\n          helvetica, Lucida Grande, arial, sans-serif;\n        font-size: 14px;\n      }\n      .graphiql-container {\n        display: flex;\n        flex-direction: row;\n        height: 100%;\n        margin: 0;\n        overflow: hidden;\n        width: 100%;\n      }\n      .graphiql-container .editorWrap {\n        display: flex;\n        flex-direction: column;\n        flex: 1;\n        overflow-x: hidden;\n      }\n      .graphiql-container .title {\n        font-size: 18px;\n      }\n      .graphiql-container .title em {...
  1. MUST allow map {extensions} parameter when accepting application/json
Status code 404 is not 200

Also related:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants