-
Hello, I have searched through the documentation but I am unable to find how to change the endpoint for my respective subgraphs dynamically. The use case would be that I want different endpoints in production/development without regenerating the supergraph using mesh. Something like: export const gatewayConfig = defineConfig({
supergraph: './supergraph.graphql',
transportEntries: {
MyApi: {
endpoint: process.env.API_ENDPOINT, // <--- Is this possible?
headers: [
['Authorization', `Bearer ${process.env.API_TOKEN}`]
]
},
}
}); For setting the header values it works perfectly using env variables, would be nice to also expose the endpoint in the gateway.config without having to regenerate the supergraph. Maybe this is already possible and I am just overlooking something. Any help is highly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You need to use export const gatewayConfig = defineConfig({
supergraph: './supergraph.graphql',
transportEntries: {
MyApi: {
location: process.env.API_ENDPOINT, // You need to use `location` instead of `endpoint`
headers: [
['Authorization', `Bearer ${process.env.API_TOKEN}`]
]
},
}
}); |
Beta Was this translation helpful? Give feedback.
You need to use
location
notendpoint
.