kadirahq / lokka-transport-http

HTTP Transport Layer for Lokka
MIT License
41 stars 38 forks source link

In Transport constructor, allow modification of all fetch options, not just headers #1

Open jimthedev opened 8 years ago

jimthedev commented 8 years ago

The fetch key is, as far as I can tell, set to 'include' without a way of overriding the value. At times during development it may be necessary to use an Access-Control-Origin of *. This will not work if credentials are sent over the wire so until we can configure the credentials value to be undefined, there is no way to work with wildcard cors.

arunoda commented 8 years ago

Check this. https://github.com/arunoda/learn-redux/blob/server-side/server/graphql.js#L8

Basically, it's like wildcard. Let me know, if that's work for you. If not, let's make some changes.

acyuta108 commented 8 years ago

I submitted a pull request allowing to add mode to options param which is somewhat related to this issue. I also advised we could actually allow options param to be fully compatible with isomorphic-fetch.

tkers commented 8 years ago

Additionally it would be nice to set the rejectUnauthorized flag (to ignore self signed certificates in development, when doing server side rendering) which is, in node-fetch, passed down by setting a custom agent (an instance of https.Agent) in the options.

To me it looks like it would be perfectly fine to simply assign the options to this._httpOptions in this line, or am I missing something?

barbalex commented 7 years ago

https://github.com/arunoda/learn-redux/blob/server-side/server/graphql.js#L8 will not work for me as I am using https://github.com/calebmer/postgraphql.

Is there a way to prevent credentials to be sent?