Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Apollo Client/Getting Started sample3
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import fetch from 'cross-fetch';
import { gql, ApolloProvider, ApolloClient, HttpLink, InMemoryCache } from '@apollo/client';
const endpoint = '' // apolloのGetting Started
const client = new ApolloClient({
link: new HttpLink({ uri: endpoint, fetch }),
cache: new InMemoryCache()
<ApolloProvider client={client}>
<App />
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment