forked from cylc/cylc-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #40 Use axios-fetch instead of node-fetch for graphql
- 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.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |