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

Adding deferSpec=20220824 to response headers breaks the Preview pane in browser devtools #7909

Open
jer-k opened this issue Jul 30, 2024 · 0 comments · May be fixed by #7915
Open

Adding deferSpec=20220824 to response headers breaks the Preview pane in browser devtools #7909

jer-k opened this issue Jul 30, 2024 · 0 comments · May be fixed by #7915

Comments

@jer-k
Copy link

jer-k commented Jul 30, 2024

Issue Description

As I was working on improving the @defer support for Next.js in apollo-server-integrations/apollo-server-integration-next#204 I noticed that when I viewed the Preview pane in Chrome devtools, it was always blank.

image

I thought it might be something going on with Next.js, but I believe it is an issue with the headers being set here https://github.com/apollographql/apollo-server/blob/main/packages/server/src/runHttpQuery.ts#L305.

  graphQLResponse.http.headers.set(
    'content-type',
    'multipart/mixed; boundary="-"; deferSpec=20220824',
  );

In my Next.js app, I rewrote the headers to be

    const headers: Record<string, string> = {
      'content-type': 'multipart/mixed; boundary="-"',
    };

And the data appears in the Preview pane
image.

Is there any reason to add the deferSpec=20220824 to the response header? Without it Apollo Client behaves properly and the devtools are able to preview the response data.

Link to Reproduction

apollo-server-integrations/apollo-server-integration-next#204

Reproduction Steps

I linked to the PR from the Next.js integration where I detailed all of this. I also have a project https://github.com/jer-k/graphql-rsc-dashboard which has a local version of @as-integrations/next installed where I'm testing this. I can create a branch of this project that sets everything up to be pulled down if need be.

@jer-k jer-k linked a pull request Aug 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant