Closed Jones-S closed 5 years ago
I also realized that I have slightly different headers (response and request) for the local call which works and the remote call which fails:
WORKS:
you can also see that the Bearer token is sent within the header, and the other time it is not... But still it would get authorized, so that may not be the problem...
FAILS with JSON parse error:
This one is actually also resolved.
I was totally confused, because I actually had CORS issue (https://github.com/markhuot/craftql/issues/316)
but I could disable those cors messages by using no-cors
in my apollo client.
Somehow this would make the response appear in the Network tab but would never reach my application.
Very weird and very mysterious error messages or rather the total lack of them caused me waisting hours and hours.
Well, it is finally resolved.
I know that this maybe related to some other stuff than craftql, but I just have to ask, because I don't know what else I can do to resolve my issue:
I am using an apollo client to fetch from a craftql service. If I fetch from localhost:3000 to a local backend domain with my craft installation. This works perfectly fine. I get a json response and it works.
If I know want to do the same on the remote (I had to resolve CORS and authorization issues first), I am also getting a response (actually the exact same), but I get an error
But I do already get JSON!
As it is exactly the same response on my local /api and from my remote /api, I was wondering if there could be any server issues that cloak my json as something else, or if a server setting somehow would make my apollo not realizing that I actually get json.
I know this sounds desperate, but I have no idea what could be the reason. I also posted this question within the nuxt/module comunity: https://cmty.app/nuxt/apollo-module/issues/c236
Where I go into more detail about the apollo settings...
If there is anybody with an idea... please send me a hint