A separate endpoint for GraphQL subscriptions

I’m using Tyk in supergraph/subgraph configuration.

My GraphQL backend has two different endpoints:

  • one for queries and mutations;
  • another one for subscriptions.

In application configuration there’s only proxy.target_url field with a target endpoint URL. I use this field to specify an URL of the first endpoint(for queries and mutations).

Question: how can I configure an endpoint for GraphQL subscriptions?

Hello @Andrey_Nado,

When you say two different endpoints do you mean two different listen paths?

/query&mutation
/subscription

If so are they separate subgraphs? If they are, what you will need to do is import each endpoint as a subgraph and then create a supergraph that will federate both graphs.

Let me know if this helps,
Zaid

1 Like

Hi @zaid

Yes, adding a separate app definition solved my problem.

Thank you!