Always take error CORS, if i try to get subgraph

Hi guys!
I cant get graph from website - https://thegraph.com/explorer/subgraph
But if i try take data from tutorial sandbox - https://48p1r2roz4.sse.codesandbox.io
All ok
What could be the problem ?
Thanks :slight_smile:

Code there โ†’

import React from 'react'; import ReactDOM from 'react-dom'; import { BrowserRouter, HashRouter } from 'react-router-dom'; 
// HraphQL.
import {
    ApolloClient,
    InMemoryCache,
    ApolloProvider,
  } from "@apollo/client";
const client = new ApolloClient({
  uri: 'https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2',
  cache: new InMemoryCache(),
});
// -----------------------------------
import App from './App';
// -----------------------------------Redux
import { Provider } from 'react-redux';
import { store } from '~Redux/store';
// style
// -----------------------------------
ReactDOM.render(
  <>
    <ApolloProvider client={client}>
        <HashRouter>
            <Provider store={store}>
              <App />
            </Provider>
        </HashRouter>
    </ApolloProvider>
  </>
,document.getElementById('AAVE')
);

Hello! I believe you are providing the incorrect URL for the GraphQL endpoint youโ€™re trying to connect to. The page at https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2 lists its โ€œQueriesโ€ URL as https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2.

If I attempt to connect to that URL in Apollo Sandbox, I connect successfully.

1 Like

Hello Stephen! Thanks its work!
All the best to you! :blush: :blush: :blush: