You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get the following error when accessing the headers object from the supergraph service response.
Rhai script is forwarding the custom response headers from subgraphs to the client.
"
Unknown property 'headers' - a getter is not registered for type 'alloc::sync::Arc<std::sync::mutex::Mutex<core::option::Option<apollo_router::services::supergraph::Response>>>'
"
response-header-forwarder.rhai:
// Configure allowed response headers
fn getAllowedResponseHeaders() {
["custom_response_header"]
}
fn copyResponseHeadersInResponse(response) {
for header in getAllowedResponseHeaders() {
if response.context[header]!=() {
response.headers[header] = response.context[header];
}
}
}
@andrewmcgivery
The response header forwarder rhai script is similar to the solution mentioned in apollographql/router#2060.
I updated the issue with code blocks. I request you please check.
I get the following error when accessing the headers object from the supergraph service response.
Rhai script is forwarding the custom response headers from subgraphs to the client.
"
Unknown property 'headers' - a getter is not registered for type 'alloc::sync::Arc<std::sync::mutex::Mutex<core::option::Option<apollo_router::services::supergraph::Response>>>'
"
response-header-forwarder.rhai:
response-header-forwarder.test.rhai:
The text was updated successfully, but these errors were encountered: