You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use sanic-graphql but am encountering a Status Code:405 Method Not Allowed error.
The <url>/graphql endpoint (graphiql) works fine. However, when trying to use the endpoint from an apollo-client website then I encounter the above-mentioned Status Code 405 error when the browser attempts an OPTION preflight request.
This is presumably somehow related to the sanic documentation for Class-Based Views which states that if the the class based view does not contain the request method (in this case the OPTION preflight request), then a 405: Method not allowed error is returned.
Is there some way to resolve this?
Thanks.
The text was updated successfully, but these errors were encountered:
Thanks for your report! This issue is indeed caused by sanic not supporting CORS and thus ignoring preflight requests.
I've created a workaround for this requests. Could you please check if it works for you? You need to clone this repo, switch to fix/preflight branch and install it to new virtual environment. Assuming your venv is active:
Uh oh!
There was an error while loading. Please reload this page.
I am trying to use
sanic-graphql
but am encountering aStatus Code:405 Method Not Allowed
error.The
<url>/graphql
endpoint (graphiql) works fine. However, when trying to use the endpoint from an apollo-client website then I encounter the above-mentioned Status Code 405 error when the browser attempts anOPTION
preflight request.This is presumably somehow related to the
sanic
documentation for Class-Based Views which states that if the the class based view does not contain the request method (in this case theOPTION
preflight request), then a405: Method not allowed
error is returned.Is there some way to resolve this?
Thanks.
The text was updated successfully, but these errors were encountered: