graphql-request icon indicating copy to clipboard operation
graphql-request copied to clipboard

Instructions for getting graphql-request to work with IE10/11

Open mwld opened this issue 9 years ago • 4 comments

Hi!

I'm using graphql-request for a small app which now (sadly) has to support IE10 and IE11.

I used several obvious polyfills (es6-promise, es6-object-assign etc.) but couldn't get requests and their handling to fully work. That's why I ended up using babel-polyfill which handles applying needed polyfills automatically.

As it bloats the resulting JS with a lot of possibly unneeded polyfills I wanted to ask you guys if you could provide a list of needed polyfills for IE10 and IE11 which could be added to the docs.

Thanks in advance.

mwld avatar Aug 23 '17 09:08 mwld

I have the same problem. I can send request, but can't get the response. My browser is safari of iphone5s.

acevlog avatar Sep 07 '17 07:09 acevlog

Would somebody be interested in contributing a "compatibility mode" as described in #22?

schickling avatar Sep 07 '17 10:09 schickling

Can you check whether 1.4.0 works for you @mwld @LiuGabi?

schickling avatar Oct 04 '17 16:10 schickling

With 1.4.0 in IE10 I get SCRIPT5009: 'Promise' is undefined.

After adding these lines:

var Promise = require('promise-polyfill');
if (!window.Promise) {
  window.Promise = Promise;
}
require('es6-object-assign').polyfill();

...it may work in some cases but I get a CORS error in my particular case, but only in IE10 (not Chrome or Firefox), which is what I'm aiming to be able to support :

SEC7118: XMLHttpRequest for https://api.graphcms.com/simple/v1/c1 required Cross Origin Resource Sharing (CORS).
SEC7119: XMLHttpRequest for https://api.graphcms.com/simple/v1/c1 required CORS preflight. 
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
Possible Unhandled Promise Rejection:TypeError: Network request failed 

map01ASCIIDOC10 avatar Oct 21 '17 18:10 map01ASCIIDOC10