I tried to consume graphQL like the example provided in the documentation using java script but i got cros origin error
Hi @myousry!
Have you tried using Apollo?
I haven’t tried it yet to be honest, but I found this article that looks interesting
Thanks for catching that! We will be reviewing our documentation
Let us know if that doesn’t work for you
Thanks again!
Tom
Hello @tomasw ,
Thanks for your reply, but i am able to call most shiphero graphQl queries and mutatios using a proxy server GitHub - Rob--W/cors-anywhere: CORS Anywhere is a NodeJS reverse proxy which adds CORS headers to the proxied request. to call graphQl endpoint and i think it is not the optimal solution so i am asking i there another solution that i can follow instead of calling proxy server from javascript client code, i have followed the same steps in the documentation passing authorization in the header … but i got cros error but this error disappeared when i used a proxy server
could you please return from your side in every response header
res.setHeader('Access-Control-Allow-Origin', '*');
// Request methods you wish to allow
res.setHeader('Access-Control-Allow-Methods', '*');
// Request headers you wish to allow
res.setHeader('Access-Control-Allow-Headers', '*');
Hi @myousry!
I apologize for the delayed response about this. We will engage our engineering team to see if we can figure this out and try to provide a better solution for this.
Thanks again for the patience!
Tom
Hi @myousry!
My apologies for the delayed response about this.
Unfortunately, we haven’t been able to reproduce this, but when we check the headers for the Queries we do notice that the header is present so it should be already available:
That screenshot is consuming the Public API using Altair
Let me know if that still doesn’t help!
Thank again!
Tom
can you please check this issue that what I am talking about Learn CORS In 6 Minutes - YouTube
I need shiphero server in response header to return this attribute with * value
access-control-allow-origin: *