question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot get schema due to Apollo-Tracing header

See original GitHub issue

This issue pertains to the following package(s):

  • GraphQL Playground Express Middleware

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

1.4.9

I’m unable to fetch the schema for my endpoint, because of the X-Apollo header that the playground adds. It should not be added to the options request (somehow). Executing queries works.

Failed to load https://api.deutschebahn.com/free1bahnql/v1/graphql: Request header field X-Apollo-Tracing is not allowed by Access-Control-Allow-Headers in preflight response.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
gpoitchcommented, Nov 13, 2019

Would be great for a way to disable tracing for those that don’t want to add this allowed header to their API.

1reaction
o-alexandrovcommented, May 1, 2019

The issue is still present as GraphQLBin.com requires us to add:

  • X-Apollo-Tracing header as part of the array of:
  • Access-Control-Allow-Headers

For all experiencing the issue, just add X-Apollo-Tracing to Access-Control-Allow-Headers, for example for AWS API Gateway the result would be:

const apiGatewayDefaultHeaders = `Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent`
const headersForPlaygroundToWork = `X-Apollo-Tracing`

const headers = {
  "Access-Control-Allow-Origin": "*", // Required for CORS support to work
  "Access-Control-Allow-Headers": `${apiGatewayDefaultHeaders},${headersForPlaygroundToWork}`,
  "Access-Control-Allow-Credentials": true, // Required for cookies, authorization headers with HTTPS
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot get schema due to Apollo-Tracing header #490 - GitHub
I'm unable to fetch the schema for my endpoint, because of the X-Apollo header that the playground adds. It should not be added...
Read more >
Exposing trace data for your GraphQL server with Apollo Tracing
The reason for including the type information is that we didn't want interpretation of the results to require knowledge of the schema, ...
Read more >
Apollo server context initialization function parameter?
My guess in the "WhatsApp-clone", the parameter comes from the subscription support of Apollo Server (here as in the github repo from ...
Read more >
apollo-server-micro | Yarn - Package Manager
The version headers in this history reflect the versions of Apollo Server itself. Versions of other packages (e.g., those which are not actual...
Read more >
Apollo-server with prisma error in extracting header information
It seems like your context.request is undefined, so that's probably where your issue is. Your setup does look correct to me though, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found