#ApolloDriverConfig CORS

1 messages · Page 1 of 1 (latest)

raw tusk
#

Where are cors settings now? Docs still providing old way to set them :/

Argument of type '{ driver: typeof ApolloDriver; autoSchemaFile: string; sortSchema: true; cors: { origin: string; }; buildSchemaOptions: { directives: GraphQLDirective[]; }; plugins: ApolloServerPlugin<...>[]; formatError(error: ErrorMagento): { ...; }; }' is not assignable to parameter of type 'ApolloDriverConfig'.
  Object literal may only specify known properties, and 'cors' does not exist in type 'ApolloDriverConfig'.
limpid rapids
lean ether
#

@raw tusk Hi! I have the same issue, did you manage to find a solution?

lean ether
#

my problem was that app.enableCors(corsSettings); was applied after app.listen , when I moved it above it worked

app.enableCors(corsSettings);
  await app.listen(4000);
raw tusk
#

@lean ether I've used cors library and I'm applying it like middleware