Skip to content

How to enable the cors handling using apollo server 4 #60

@vperumalgoeasy

Description

@vperumalgoeasy

Hi,

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions