Can we use Kong api gateway for GraphQL service based backend service?

1k views Asked by At

I have a backend service in graphQL and I want to integrate it with kong for proxying. I had followed the same steps of how we configure a http service in kong using this link https://docs.konghq.com/0.13.x/getting-started/configuring-a-service/

But when i hit the request via the kong proxy endpoint which has been created it throws 404 error. Can someone please help is there any additional configuration required to route the graphQL service? I am looking for open source kong edition.

1

There are 1 answers

0
wave On

What you have done here is created a service which will upstream to an endpoint. But you ll also have to specify which routes are to be upstreamed to that endpoint.

for eg: http://localhost:7001/testapi > testapi is your route which needs to be upstreamed to the endpoint.

When kong finds nothing like the route which you are trying to access it throws 404.

you can add your routes by setting the paths attribute.

check this on how to bind your service with the routes https://docs.konghq.com/gateway-oss/0.13.x/admin-api/#route-object