This morning, we started receiving the error below on all of our graphql API requests:
Access to fetch at 'https://<registry name>.cdn.prismic.io/graphql?query=<query>' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
We figured out the problem. At some point, support for querying by uid for _allDocuments was removed. We weren't passing in any uid, but removing the unused query parameter solved the problem.
It would have been nice to have a more relevant error message, though.
1 Like
system
(system)
closed as resolved, flag & select 'Something Else' to reopen.
3
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
This post has saved me. I spent most of the day on a wild goose chase over this same bogus CORS error message. In our case, the real problem was an incorrectly named parameter being supplied to our GraphQL query.
This misleading error message very much needs to be addressed.
Yes, I agree and see how that can be frustrating. We plan to improve the error messaging as part of the larger improvements that will happen to the GraphQL API.
If/when this happens we'll update you here.
Thanks.
Phil
(Phil Snow)
closed , flag & select 'Something Else' to reopen.
18
Threads close after a period of inactivity. Flag this thread to re-open it and continue the conversation.