我已经使用reactjs设置了ApolloClient
。我已经在URL http://localhost:3044/graphql
上创建了服务器。现在,我需要测试它是否连接到该后端URL。我该怎么办?
import ApolloClient from 'apollo-boost';
import { HttpLink } from 'apollo-link-http';
import { InMemoryCache } from 'apollo-cache-inmemory';
const BASE_URL = 'http://localhost:3055/graphql';
const cache = new InMemoryCache();
const httpLink = new HttpLink({
uri: BASE_URL
});
export const client = new ApolloClient({
uri:BASE_URL
});
ReactDOM.render(
<ApolloProvider client={client}>
<App />
</ApolloProvider>
, document.getElementById('root'));
谢谢!