CORS 500 errors when requesting "/graphql/execute.json" on dispatcher.
Hi,
I have a front end JavaScript application, which needs to get data from a persistent query exposed at "https:wwwstage.companyx.com/graphql/execute.json/quizzes/quizone"
Tried to make a fetch GET call to above url in front end javascript code, resulting in 500 CORS error.
I enabled , CORS chrome plugin, but that did not help and still got 500 CORS issue.
Note: I am able to see content fragments json , when I hit the url directly in a browser.
I added below in vite.config.ts file, which resulted in http://localhost:4400/graphql/execute.json/quizzes/quizone , 404 error.
export default defineConfig({
server: {
proxy: {
// Using the proxy instance
'/graphql': {
target: 'https://wwwstage.companyx.com',
changeOrigin: true,
},
},
},
})
Any ideas, why I am not able to hit GraphQL end point to do headless delivery of content and any ideas on work around.
Thanks,
Sree