sangria-graphql/sangria-playground

GraphiQL app requests using POST don't work - add warning in docs

meddulla opened this issue · 2 comments

Hi,

This app has the CORS filter enabled which, since GraphiQL app sends the header "Origin:null", makes POST requests fail. I know GraphiQL is embedded in a template but I was trying to debug why my custom app wasn't working in GraphiQL so download this repo to make sure I wasn't missing anything and lo and behold! GraphiQL doesn't work here either. After some trial and error, finally understood that the problem was the Origin header that GraphiQL was sending...
So to save other people'e time, a small note in the documentation would be nice. For example, something like this:

Warning to GraphiQL app users
Due to the fact that GraphiQL sends the Origin header as null (see skevy/graphiql-app#53), in apps that have CORS enabled, POST requests won't work. Either use the embedded GraphiQL view or disable CORS.

Thanks a lot for Sangria by the way :)

Just to let you know that an Origin was added to GraphiQL App: skevy/graphiql-app#66
It's: electron://graphiql-app

Noting that the new graphql-playground seems to have the same issue:
graphql/graphql-playground#296