Skip to content

Commit 75bdd4a

Browse files
committed
fix example
1 parent 9317b73 commit 75bdd4a

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

example/src/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
const { GitHub } = require('graphql-binding-github')
1+
const { Github } = require('../../dist/index')
22
const { GraphQLServer } = require('graphql-yoga')
33

4+
console.log({Github})
5+
46
const favoriteRepos = [
57
{ owner: 'graphcool', name: 'graphql-yoga' },
68
{ owner: 'graphql', name: 'graphql-js' },
79
]
810

911
const token = process.env.GITHUB_TOKEN || ''
10-
const github = new GitHub(token)
12+
const github = new Github(token)
1113

12-
const typeDefs = '.schemas/app.graphql'
14+
const typeDefs = './schemas/app.graphql'
1315
const resolvers = {
1416
Query: {
1517
hello: (parent, { name }) => `Hello ${name || 'World'}!`,
@@ -19,7 +21,7 @@ const resolvers = {
1921
)
2022
},
2123
},
22-
...github.remoteResolvers(typeDefs),
24+
...github.getAbstractResolvers(typeDefs),
2325
}
2426

2527
const server = new GraphQLServer({ resolvers, typeDefs })

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"schema"
99
],
1010
"scripts": {
11-
"prepare": "npm run build",
11+
"prepare": "npm run build; cp src/schema.graphql dist/schema.graphql",
1212
"build": "rm -rf dist && tsc -d",
1313
"test": "echo No tests yet"
1414
},
@@ -17,7 +17,7 @@
1717
"apollo-link-http": "1.5.3",
1818
"cross-fetch": "2.1.1",
1919
"graphql": "0.13.2",
20-
"graphql-binding": "^1.4.0-beta.21",
20+
"graphql-binding": "^1.4.0-beta.22",
2121
"graphql-tools": "2.23.1"
2222
},
2323
"devDependencies": {

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,19 @@ get-stream@^3.0.0:
160160
version "3.0.0"
161161
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
162162

163-
graphql-binding@^1.4.0-beta.21:
164-
version "1.4.0-beta.21"
165-
resolved "https://registry.yarnpkg.com/graphql-binding/-/graphql-binding-1.4.0-beta.21.tgz#c048dcd0e4e1756dff814ca7faed91dd9df674d3"
163+
graphql-binding@^1.4.0-beta.22:
164+
version "1.4.0-beta.22"
165+
resolved "https://registry.yarnpkg.com/graphql-binding/-/graphql-binding-1.4.0-beta.22.tgz#6a0d15b81d4d9c45f5e088e4750e77586c6a3dcb"
166166
dependencies:
167-
graphql-import "^0.5.0"
167+
graphql-import "^0.5.2"
168168
graphql-tools "3.0.0"
169169
iterall "1.2.2"
170170
object-path-immutable "^1.0.1"
171171
resolve-cwd "^2.0.0"
172172
ts-node "^6.0.2"
173173
yargs "^11.0.0"
174174

175-
graphql-import@^0.5.0:
175+
graphql-import@^0.5.2:
176176
version "0.5.2"
177177
resolved "https://registry.yarnpkg.com/graphql-import/-/graphql-import-0.5.2.tgz#d7e05dc07d2d66e8d8c4bd408650f9fdaeddb8f8"
178178
dependencies:

0 commit comments

Comments
 (0)