According the Apollo Server documentation, the CORS option is not available in server configuration.
"Note that apollo-server-micro
does not have a built-in way of setting CORS headers."
when we create a apollo server, we can't set the cors options in the configuration object.
As a result, we should encounter the following CORS policy issue
Access to fetch at 'http://localhost:3000/api/graphql' from origin 'https://studio.apollographql.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: 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.
Since we can't add the cors option with the configruation object, we have to manually add those cors options in the handler function
Now the cross site access violation should be resolved and we can manipulate the query and mutation in the apollo-studio.