Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to expose GraphQL response headers to serverSidePostQuery #90

Open
Meemaw opened this issue Jun 9, 2023 · 1 comment
Open

Try to expose GraphQL response headers to serverSidePostQuery #90

Meemaw opened this issue Jun 9, 2023 · 1 comment

Comments

@Meemaw
Copy link

Meemaw commented Jun 9, 2023

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.

@rrdelaney
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants