How to forward headers & request to subgraph and to another subgraph #3179
Replies: 5 comments 2 replies
-
I'm not sure why your headers aren't being propagated to the cart subgraph. It may be because you have quoted your matching pattern. I don't think that is valid syntax. Your request may not result in a fetch from products, but if it does, then it won't receive any forwarded headers, because you have only configured forwarding to your We have a number of examples of how to configure this. Here's how to propagate all headers to all subgraphs:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply. We have even tried with
I mean, from router, the request is only coming to the Here is our folder structure, And we are using the below commands to start the router server
And, another query, do we need to execute these two commands every time we change config.yaml file? Thanks, |
Beta Was this translation helpful? Give feedback.
-
Thanks for your reply. We have followed this article to create supergraph file. Then we tried to use the supergraph.graphql to start the router server. If we try with
Could you please assist us with what is missing in the YAML file? |
Beta Was this translation helpful? Give feedback.
-
We just realized that these two But the request values are not getting forwarded from one Subgraph to another Subgraph. We have given the product model as an entity in the
And then from the
But we are only getting We even tried adding
but getting the GraphQL validation error,
Here is our request body which is been triggered from supergraph - http://127.0.0.1:4000/.
Could you please assist in getting the |
Beta Was this translation helpful? Give feedback.
-
I have also posted the same question there too. Thanks for your reply. Closing the question here. |
Beta Was this translation helpful? Give feedback.
-
Hello Everyone,
We are new to GraphQL language and currently implementing a middleware layer with apollo studio.
Currently, we have two subgraphs (Cart & Product) and one supergraph (router gateway).
And the use case is,
To get the user cart, the front-end team must pass the token in the authorization header along with some request parameters (ex: locale, Currency code). So that the cart subgraph can use them to get his/her basket and then get the product entity from Product Subgraph.
in cart.graphql, we have added Product Entity
extend type Product @key(fields: "id") { id: ID! @external }
And our config.yaml file is
But we are facing two issues here,
Could you please suggest to us?
Thanks,
Sreekanth
Beta Was this translation helpful? Give feedback.
All reactions