0

I want to be able to have a GraphQL API (.NET) that will accept any request and then forward it to another GraphQL API. Is it possible to do this in some simple manner? Reason for it is that the first API will be adding some additional headers to the request that is being forwarded to the other API.

Anyone has any ideas ?

Thanks !

Branislav B.
  • 509
  • 7
  • 21

2 Answers2

2

Hot Chocolate is working on a fusion feature where it will stitch together disparate GQL APIs into a single one. The docs can be found here: https://chillicream.com/docs/hotchocolate/v13/distributed-schema

However, if you are just looking for a .NET reverse proxy, consider YARP: https://microsoft.github.io/reverse-proxy/

chrisdrobison
  • 1,323
  • 2
  • 13
  • 24
0

Does your first API need to process graphql body? If not it sounds like simple REST API controller will be just fine for you. So you can create post-method named graphql and send request to second API inside of it. Graphql body should be manipulated as string because of transfer-only purpose. And core-logic of method will be enrichment of http-headers

Eugene
  • 169
  • 1
  • 6