apollo-link-persisted-queries
apollo-link-persisted-queries copied to clipboard
CORS GETs issue a PREFLIGHT OPTIONS call. Can we swtich the content-type or not?
I'm using this amazing package for persisted queries and { useGETForHashedQueries: true }.
Everything works good but I think something is happening if I use ApolloServer with CORS (which I hate and in the future I think I will avoid them with something like a proxy or what will be).
Now the problem is I see some GETs with PREFLIGHT OPTIONS calls.
I think this is happening because of content-type: application/json in Request Headers.
Can we switch this Content-Type to ex. text/plain.
I'm newbie, I don't know if there is a security concern changing the Content-Type.

+1
Same question
We are also experiencing this issue. As we do have a quite huge amount of different users, our backend(running on cross origin) has to handle mainly cors requests(yes, we are setting cors caching headers).
I tried setting content-type to "text/plain" in createHttpLink-options. This caused no more preflight requests. At the same time it prevents persisting new queries via post-request. In this case we need to have different content-types for get and post requests each.