How to solve CORS policy problem for Strapi?

Hello people,
Hope this helps someone like me.

Summary
In my frontend apollo-client I have given the uri without ‘http://’

Front-end
Framework: Angular
Graphql client: apollo-client
File path: app > graphql.module.ts
To do: Check if the value of constant uri correct. If it is localhost, give ‘http://localhost:1337’(replace the port number with yours)