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.

Support OPTIONS requests

See original GitHub issue

Hi, I keep getting a 405 when using the example code, and I’m wondering if it’s a CORS issue, since my frontend and backend are running on different ports. If so, how do I enable CORS with Ariadne?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
patryscommented, Aug 12, 2019

You can wrap one in the other:

CORSMiddleware(GraphQL(...))

GraphQL middlewares are separate from ASGI middlewares.

2reactions
rafalpcommented, Feb 4, 2019

Yeop, Ariadne only supports GET and POST, missing OPTIONS 😂

We’ll be fixing that, but in meantime you would have to wrap GraphQLMiddleware with a custom one that handles OPTIONS request and sends CORS headers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OPTIONS - HTTP - MDN Web Docs
The HTTP OPTIONS method requests permitted communication options for a given URL or server. A client can specify a URL with this method, ......
Read more >
How do I send OPTIONS request? - ReqBin
The HTTP OPTIONS request is used to describe communication options for the target resource. Browsers send HTTP OPTIONS requests to find out the ......
Read more >
Why is an OPTIONS request sent and can I disable it?
Options request is a preflight request when you send (post) any data to another domain. It's a browser security issue. But we can...
Read more >
Why Is an OPTIONS Request Sent? - Baeldung
The OPTIONS request mentioned in the introduction is a preflight request, which is part of the CORS (Cross-Origin Resource Sharing).
Read more >
OPTIONS Requests: How to Deal - Medium
OPTIONS requests are pre-flight requests in Cross-origin resource sharing (CORS). When you are making an HTTP or Ajax request to a server that...
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