-
Hi, I'm exploring Wundergraph for a potential project. In this project:
Is this an intended use-case for Wundergraph? If so, I'd really appreciate pointers for how to best approach #2 and #3A. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Is this a good use case for WunderGraph? Yes, absolutely! Merging APIs, unifying them, federated auth, absolutely! How to solve 2/3? Step 1, configure dynamic origin headers, like this example: https://docs.wundergraph.com/docs/wundergraph-config-ts-reference/configure-headers-for-http-based-data-sources#dynamic-headers E.g. if your origin named foods the Authorization header, you can forward the client request header "X-Foo-Authorization" as Authorization header. If you're calling this from a backend, you already have access to the access token I guess, so you can set the header yourself. If you're calling it from a frontend client, you can use a pre resolve hook to set the header. The header can be fetched using the user identity. Here's an example for such a hook: Do you think this will work? I hope I correctly understood your use case. Otherwise please expand. |
Beta Was this translation helpful? Give feedback.
-
@jensneuse Thank you for the very quick response -- you've put me on the right path for the solution, and made me feel better about Wundergraph as a vendor. Great to know there's responsive help available :) PS: What I've seen of your product so far is very, very promising. Super cool project, keep up the great work! |
Beta Was this translation helpful? Give feedback.
Is this a good use case for WunderGraph? Yes, absolutely! Merging APIs, unifying them, federated auth, absolutely!
How to solve 2/3?
Step 1, configure dynamic origin headers, like this example: https://docs.wundergraph.com/docs/wundergraph-config-ts-reference/configure-headers-for-http-based-data-sources#dynamic-headers
E.g. if your origin named foods the Authorization header, you can forward the client request header "X-Foo-Authorization" as Authorization header.
If you're calling this from a backend, you already have access to the access token I guess, so you can set the header yourself.
If you're calling it from a frontend client, you can use a pre resolve hook to set the header. The h…