When you first attempt to connect a GraphOS cloud router to your GraphQL endpoint, Studio might display an error like the following:
Endpoints need to be available on the public internet. Please deploy your API before continuing.
Additionally, messages like the following might appear in your browser's developer console:
⚠️ Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:9000/. (Reason: CORS header 'Access-Control-Allow-Origin' missing). Status code: 204.
⚠️ Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:9000/.
(Reason: CORS request did not succeed). Status code: (null).
Errors like these are usually related to Cross-Origin Resource Sharing (CORS). To resolve them, modify your GraphQL endpoint's access-control-allow-origin
header to allow requests from https://studio.apollographql.com
. Consult your server library's documentation to learn how to modify this header.
If you're using Apollo Server, learn how to configure CORS.
Comments
0 commentsPlease sign in to leave a comment.