You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title: Help with CORS Error in Payload CMS GraphQL API on Localhost
Question:
I'm working with Payload CMS and have set cors: * in my build configuration. However, when I try to fetch data using the following GraphQL API request:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Title: Help with CORS Error in Payload CMS GraphQL API on Localhost
Question:
I'm working with Payload CMS and have set cors: * in my build configuration. However, when I try to fetch data using the following GraphQL API request:
API URL: http://localhost:3001/api/graphql
Request Body:
{ "query": "query GetMcqSubmission($student_id: McqSubmission_student_id_operator!) { McqSubmissions(where: { student_id: $student_id }) { docs { pointsScored } } }", "variables": { "student_id": { "equals": "672b8c3807cb9b85c8d415fd" } } }
I’m seeing a CORS error in the browser, even though CORS is configured as *. Could anyone help me troubleshoot this issue or suggest a fix?
Beta Was this translation helpful? Give feedback.
All reactions