Skip to content

Instantly share code, notes, and snippets.

@ryanbelke
Last active May 17, 2020 00:44
Show Gist options
  • Save ryanbelke/44964458090e943030863260a572eee4 to your computer and use it in GitHub Desktop.
Save ryanbelke/44964458090e943030863260a572eee4 to your computer and use it in GitHub Desktop.
/* /lib/apollo.js */
import { HttpLink } from "apollo-link-http";
import { withData } from "next-apollo";
const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:1337"
const config = {
link: new HttpLink({
uri: `${API_URL}/graphql`, // Server URL (must be absolute)
})
};
export default withData(config);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment