Note: If your issue/feature-request/question is regarding the AWS AppSync service, please log it in the
official AWS AppSync forum
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Custom headers are not being forwared to my lambda which is configured as a resolver for subscription requests
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
I used the code below and when I checked my lambda from context its not showing this custom header and I ensured this is whitlisted in cloudfront as well
const appsyncClient = new AWSAppSyncClient(AppSyncConfig, {
defaultOptions: {
query: {
fetchPolicy: 'network-only',
errorPolicy: 'all',
},
},
link: createAppSyncLink({
...AppSyncConfig,
resultsFetcherLink: ApolloLink.from([
setContext((request, previousContext) => ({
headers: {
...previousContext.headers,
'my-custom-header':'123456'
},
})),
createHttpLink({
uri: AppSyncConfig.url,
}),
]),
}),
});
What is the expected behavior?
Custom header should be available in lambda
Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions?
"aws-appsync": "4.0.3",
import { setContext } from "apollo-link-context"; 1.0.8
import { ApolloLink } from "apollo-link"; 1.2.2
import { createHttpLink } from "apollo-link-http"; 1.5.4
Do you want to request a feature or report a bug? Bug
What is the current behavior? Custom headers are not being forwared to my lambda which is configured as a resolver for subscription requests
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. I used the code below and when I checked my lambda from context its not showing this custom header and I ensured this is whitlisted in cloudfront as well const appsyncClient = new AWSAppSyncClient(AppSyncConfig, { defaultOptions: { query: { fetchPolicy: 'network-only', errorPolicy: 'all', }, }, link: createAppSyncLink({ ...AppSyncConfig, resultsFetcherLink: ApolloLink.from([ setContext((request, previousContext) => ({ headers: { ...previousContext.headers, 'my-custom-header':'123456' }, })), createHttpLink({ uri: AppSyncConfig.url, }), ]), }), });
What is the expected behavior? Custom header should be available in lambda Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions?
"aws-appsync": "4.0.3", import { setContext } from "apollo-link-context"; 1.0.8 import { ApolloLink } from "apollo-link"; 1.2.2 import { createHttpLink } from "apollo-link-http"; 1.5.4