I am facing an issue in cors. We are not able to allow the Access-Control-Allow-Origin
. Please let us know how to add the headers or how to handle the Cors issue.
Below added my code snippet.
const { ApolloServer } = require('@apollo/server');
const { startServerAndCreateHandler } = require('@as-integrations/azure-functions');
const server = new ApolloServer({
typeDefs,
resolvers,
csrfPrevention: false,
});
exports.graphqlHandler = startServerAndCreateHandler(server);
Thanks in advance 🙂
We are trying to solve the cors issue in apollo server 4 with azure integration.
New contributor
4
search for CORS in the documentation for
apollo/server
2 hours ago
Check this document @vasanthsp
2 hours ago
There is no document for Azure integration
2 hours ago
Try with the code
app.use( '/graphql', cors({ origin: ['https://www.your-app.example', 'https://studio.apollographql.com'] }) as mentioned in this [document](https://www.apollographql.com/docs/apollo-server/security/cors/) );
1 hour ago