Skip to content

Instantly share code, notes, and snippets.

@bengrunfeld
Created June 21, 2020 08:17
Show Gist options
  • Save bengrunfeld/3a159d1e1e8b7259e7ff143c5bb7d72f to your computer and use it in GitHub Desktop.
Save bengrunfeld/3a159d1e1e8b7259e7ff143c5bb7d72f to your computer and use it in GitHub Desktop.
GraphQL-Apollo-NextJS Starter App - pages/index.jsx
import { ApolloProvider } from "@apollo/react-hooks";
import ApolloClient, { gql } from "apollo-boost";
import { BookInfo } from "../components/BookInfo";
const Home = ({ data }) => {
const client = new ApolloClient({
uri: "http://localhost:3000/api/graphql-data",
});
return (
<ApolloProvider client={client}>
<div>
<h1>NextJS GraphQL Apollo App</h1>
<BookInfo />
</div>
</ApolloProvider>
);
};
export default Home;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment