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.

Getting 405 error when calling graphql from JS

See original GitHub issue

I installed corsheaders, and set to allow all. But I’m still getting the error. I’m using isomorphic-fetch but I guess the error would appear regardless.

INSTALLED_APPS = [
...
'corsheaders',
]


CORS_ORIGIN_ALLOW_ALL = True
Failed to load resource: the server responded with a status of 405 (Method Not Allowed)
:8000/#/repos/facebook/react?_k=d4wsv1:1 

Fetch API cannot load http://localhost:8000/graphql. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:8000' is therefore not allowed access. The response had HTTP status code 405. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

0reactions
mraakcommented, May 8, 2017

No, should I? I want my graphiql to still work. Anyway I tried but still the same.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting 405 error, Node Js - Method not found - Stack Overflow
I am trying to run a server in node js, its actually a GraphQL server. I am just calling the ...
Read more >
How to Fix the HTTP 405 Method Not Allowed Error - Kinsta®
It's an HTTP response status code that indicates that the request method is known by the server but is not supported by the...
Read more >
Why your Website is giving an HTTP 405 Method Not Allowed ...
The HTTP 405 Method Not Allowed occurs when the client sends a request to the server, and the server understands the request but...
Read more >
405 Method Not Allowed - HTTP - MDN Web Docs
The HyperText Transfer Protocol (HTTP) 405 Method Not Allowed response status code indicates that the server knows the request method, ...
Read more >
Error handling - Apollo GraphQL Docs
If a request uses an invalid HTTP method ( GET with a mutation, or any HTTP method other than GET or POST ),...
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