Skip to content

Commit

Permalink
Issue #40 Use axios-fetch instead of node-fetch for graphql
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruno P. Kinoshita committed Mar 5, 2019
1 parent 1a1eb9a commit cb62920
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/graphql.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// import { createProvider } from './vue-apollo'
import ApolloClient from 'apollo-boost'
import fetch from 'node-fetch'
import axios from 'axios';
import { buildAxiosFetch } from 'axios-fetch'

// GraphQL
const apolloClient = new ApolloClient({
// You should use an absolute URL here
uri: "https://api.graphcms.com/simple/v1/awesomeTalksClone",
// we must define fetch, as otherwise running unit tests it would fail as there is no global fetch variable
fetch: fetch
fetch: buildAxiosFetch(axios)
});

export default apolloClient

0 comments on commit cb62920

Please sign in to comment.