Use Tyk Open Source Gateway as multi-service GraphQL Proxy Server

I wanted to Tyk OpenSource gateway as GraphQL proxy. Are there any tutorials regarding how to configure the conf file?
I have 3-4 graphQL microservice which needs to be proxied via Tyk Open Source Gateway.
Note: Dashboard is not present. Only the Gateway(All open Source)

Hi @vyj7, welcome to the community.

At the moment, GraphQL tutorials for open source is scarce. If you understand how to craft REST APIs then you can use this doc to orchestrate your own GraphQL API definitions.

We understand it may be challenging to craft more advanced GraphQL APIs without the dashboard. So we recommend getting a trial version of the dashboard to test out functionality and observe what raw API definition looks like.

Hope this helps.

Hey,
Thanks for the reply.
On creating it from dashboard, where will be the configuration saved ?

Hi @vyj7, do you mean the dashboard configuration or the API definition?

If API definition, then you can find it by viewing the raw definition as shown below

If dashboard configuration, then it depends on whether you are using OnPrem or Ara (cloud). For Ara the config is handled and managed by our team. However for OnPrem, you can find it in the Nodes and Licenses blade.

We have some video tutorials that could help you setup

Hey @Olu, Thanks for the explanation. I see those on UI but where these are stored inside the gateway.
I couldn’t locate them inside the gateway or in the backend system.
Also, I added 2-3 graphQL services into the gateway but they have to be provided with different paths.
Like for G_API1 : path would be something else and it will route the graphQL api1.

I wanted to do something like this:

Single GraphQL endpoint ---- Proxied the calls based on the Operation is asked(Query or mutation or subscription). Just like a GraphQL Stichter does but without stiching them altogehter.

@vyj7 I have split my responses in two parts below:

I see those on UI but where these are stored inside the gateway. I couldn’t locate them inside the gateway or in the backend system.

  1. When using the dashboard the API definition is stored in the MongoDB specified in the dashboard config file. It is inaccessible on Ara (cloud) since we manage that. For the OSS gateway, you would need to map the physical path where the API definition exists on the machine. You can read more here

I wanted to do something like this:

Single GraphQL endpoint ---- Proxied the calls based on the Operation is asked(Query or mutation or subscription). Just like a GraphQL Stichter does but without stitching them altogether.

  1. You achieve this you would need to use our Universal Data Graph (UDG). We have a doc that can help you get started on creating a schema and mapping a GraphQL source.
    image

For a quick look at how it works, we have a video tutorial that shows how you can stich REST APIs with graph. The difference in your case would be the Data source type being set to GraphQL or Tyk GraphQL as shown below

image

Hope this helps.

Hey,
Thanks for the information.
I was able to set up by following video tutorial.
Universal Data Graph seems to be a way of doing it because it is stitching the schema.
I think it is not the part of Open-Source gateway. Am I saying this right??

If you mean the UI not being part of the OSS gateway then yes you are correct. The UI to orchestrate UDG is part of the dashboard which requires a license.

However, UDG is implemented in the gateway and you don’t need a license to initiate an API call with UDG. As long as you can construct the raw API definition properly with your UDG requirements, it will work.