Kong routing fails for graphQL API

My backend grpahQL endpoint looks like this http://localhost:80/query and using graphQL query to call my backend api.

I configured my service as below
{
“host”: “localhost”,
“id”: “b3e2c794-99d5-48d8-8522-54b78a89f396”,
“protocol”: “http”,
“read_timeout”: 60000,
“tls_verify_depth”: null,
“port”: 80,
“updated_at”: 1611241742,
“ca_certificates”: null,
“created_at”: 1611241742,
“connect_timeout”: 60000,
“write_timeout”: 60000,
“name”: “test”,
“retries”: 5,
“path”: “/query”,
“tls_verify”: null,
“tags”: null,
“client_certificate”: null
}

I configured my route as below:

{
“id”: “04ba3459-6eaa-491e-8af1-ae9335e813d9”,
“tags”: null,
“paths”: null,
“destinations”: null,
“headers”: null,
“protocols”: [
“http”,
“https”
],
“strip_path”: true,
“created_at”: 1611241759,
“request_buffering”: true,
“hosts”: [
“localhost”
],
“name”: null,
“updated_at”: 1611241759,
“snis”: null,
“preserve_host”: false,
“regex_priority”: 0,
“methods”: null,
“sources”: null,
“response_buffering”: true,
“https_redirect_status_code”: 426,
“path_handling”: “v0”,
“service”: {
“id”: “b3e2c794-99d5-48d8-8522-54b78a89f396”
}
}

While hitting the request via postman

http://konghost:80/query + graphQL query data as a body

I am getting error as 404 method not found

See the solution here: Can I have a graphQL API as a upstream using kong gateway? - #5 by rviegas

I hope this helps


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ