Apollo4 and GraphQL CORS

Apollo4 and GraphQL CORS


-1

I’m trying to access my graphQL server on my production server but getting the CORS error.

The request url is: https://mov****.at/graphql

In my index.mjs where I start the Apollo server I have CORS defined as so:

app.use(
  '/graphql',
  cors({ origin: ['https://mov***.at', 'https://mov***.at/graphql', 'https://studio.apollographql.com'] }),
  bodyParser.json(),
  expressMiddleware(server),
);

And in my graphql.module.ts I have the uri defined like so const uri = 'https://mov***.at/graphql';

I’ve read > https://www.apollographql.com/docs/apollo-server/security/cors/#configuring-cors-options-for-apollo-server but I’m not resolving the issue.

1

  • What CORS error?

    – jub0bs

    13 mins ago


Load 7 more related questions


Show fewer related questions

0



Leave a Reply

Your email address will not be published. Required fields are marked *