# Apollo server - response headers

**URL:** <https://community.apollographql.com/t/apollo-server-response-headers/5996>\
**Category:** Server\
**Tags:** server\
**Created:** [March 22, 2023, 7:56am UTC](https://community.apollographql.com/t/apollo-server-response-headers/5996 "2023-03-22T07:56:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![JustinasU](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@JustinasU](https://community.apollographql.com/u/JustinasU)\
**Post date:** [March 22, 2023, 7:56am UTC](https://community.apollographql.com/t/apollo-server-response-headers/5996/1 "2023-03-22T07:56:23Z")

</div>

Hi,  
I have issue with response headers from server, which do not pass to client.  
My Apollo server:

```auto
console.time('⏳ ~ gatewayBuilder')
export const gatewayBuilder = async (app: Express, serviceList: ServiceEndpointDefinition[]) => {
  console.time('⏳ ~ ApolloGateway')
  const gateway = new ApolloGateway({
    serviceList,
    buildService: ({ url }) => new TenantDataSource({ url }),
  })
  console.timeEnd('⏳ ~ ApolloGateway')

  console.time('⏳ ~ ApolloServer')

  const plugins = []
  if (process.env.PLAYGROUND_ENABLED === "true") {
    plugins.push(ApolloServerPluginLandingPageGraphQLPlayground())
  }

  const server = new ApolloServer({
    gateway,
    plugins: plugins,
    introspection: true,
    context: ({ req, res }) => {
      res.append("Access-Control-Expose-Headers", "X-Correlation-ID");

      const tenantId = req.headers['x-tenantid'] || null
      const acceptLanguage = req.headers['accept-language'] || null
      const authorization = req.headers.authorization || GLOBAL_VARS.authToken
      const correlationId = req.headers['x-correlation-id'] || null

      return { tenantId, acceptLanguage, authorization, correlationId, req, res }
    },
    formatError: (err: GraphQLError) => {
      logger.error('----------------------------')
      console.error('❌ ~ ApolloServer err: ', err)
      return new ApolloError(err.message, err.extensions.exception?.code, err.extensions)
    }    
  })
  console.timeEnd('⏳ ~ ApolloServer')

  await server.start()

  server.applyMiddleware({ app, path: '/graphql'})
}
console.timeEnd('⏳ ~ gatewayBuilder')

```

My BE server (Java Spring) returns custom response header: **X-Correlation-ID**  
In **didReceiveResponse** I see what response header:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/apollographql/original/2X/f/f2db81aef72d29a1bd1f060936669d46891c3aba.jpeg)

But how pass that header to client?  
Thanks

---

<div class="post-metadata">

**Author:** ![Marucom247](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/marucom247/32/4072_2.png) [@Marucom247](https://community.apollographql.com/u/Marucom247)\
**Post date:** [March 22, 2023, 2:21pm UTC](https://community.apollographql.com/t/apollo-server-response-headers/5996/2 "2023-03-22T14:21:10Z")

</div>

How can start a business for Apollo

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:49pm UTC](https://community.apollographql.com/t/apollo-server-response-headers/5996/3 "2025-02-06T20:49:15Z")

</div>


