Zend certified PHP/Magento developer

CORS issue fails the communicatin within Magento 2 (Graphql) instance and React app: Response to preflight request doesn’t pass access control check:

Getting following error trying to fetch data from react app.

  1. Magento 2.4.2

  2. Reac JS v17

  3. Apollo/Client 3

     import { ApolloClient, InMemoryCache } from "@apollo/client";
    
    
     export const client = new ApolloClient({ 
           uri: "https://someurl/graphql",
           cache: new InMemoryCache(),
     });
    

I also tried to add “no-cors” as suggested but still its not working

fetchOptions: {
    mode: 'no-cors',
  },

enter image description here