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.

GraphiQL does not work with helmet on

See original GitHub issue

Hi. I was trying to get GraphiQL to work but it got blocked with Content Security Policy errors as seen below:

1

I disabled fastify-helmet and was able to get it working properly. Am I missing some config here?

There are similar issues, but with playground though: https://github.com/graphql/graphql-playground/issues/1283#issuecomment-703631091

I guess its better to use local js files with GraphiQL rather than files from the CDN (I may be wrong here). Thanks.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
danielreardencommented, Nov 24, 2020

@tvvignesh As of version 1.0.0, you can pass a nonce value to renderGraphiQL. I’ve also added a CSP example here that shows how to integrate helmet.

2reactions
danielreardencommented, Nov 13, 2020

Yes I am considering a similar approach for renderGraphiQL although it wouldn’t use that transform.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Express: GraphiQL doesn't work with Helmet middleware #4648
I'm using "apollo-server-express": "^2.18.2" and helmet middleware. Apollo GraphiQL scripts won't load when helmet is loaded. Expected behavior:
Read more >
Usage of helmet in default configuration blocks graphql ...
I am using graphQL and helmet at the same time. I think which is stopping my graphQL api playground. THIS MY CODE I...
Read more >
Proper helmet settings that allow Apollo Sandbox to work - Help
Hi! When we enable helmet (with the default configuration, app.use(helmet()), we are no longer able to use Apollo Sandbox.
Read more >
Using PostGraphile as a Library
Library mode is the most popular way of running PostGraphile; it gives more power than using the CLI (see CLI usage), but is...
Read more >
The Anatomy of a GraphQL Request – The Guild
If there is any typo or syntax error, this phase will yield GraphQLErrors for each of those issues and pass them back to...
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