We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90f3929 commit fd067ecCopy full SHA for fd067ec
package.json
@@ -17,6 +17,9 @@
17
"nodemon": "^1.18.4"
18
},
19
"dependencies": {
20
- "dotenv": "^6.1.0"
+ "apollo-boost": "^0.1.17",
21
+ "cross-fetch": "^2.2.2",
22
+ "dotenv": "^6.1.0",
23
+ "graphql": "^14.0.2"
24
}
25
src/index.js
@@ -0,0 +1,14 @@
1
+import 'dotenv/config';
2
+import 'cross-fetch/polyfill';
3
+import ApolloClient from 'apollo-boost';
4
+
5
+const client = new ApolloClient({
6
+ uri: 'https://api.github.com/graphql',
7
+ request: operation => {
8
+ operation.setContext({
9
+ headers: {
10
+ authorization: `Bearer ${process.env.GITHUB_PERSONAL_ACCESS_TOKEN}`,
11
+ },
12
+ });
13
14
+});
0 commit comments