RevereCRE/relay-nextjs

Try to expose GraphQL response headers to serverSidePostQuery

Meemaw opened this issue · 1 comments

It would be great if response headers from the GraphQL request done on server would be exposed to serverSidePostQuery.

Use-case:
Backend can set the cache-control header on GraphQL responses, which could be read in serverSidePostQuery and set on the page:

serverSidePostQuery: (_, ctx) => {
    ctx.res.setHeader(
      'cache-control',
      headerFromBackend
    );
  }

Could try to contribute this, if you think this makes sense and would be open to accepting PR for it.

This is a great idea! Would happily accept a PR!