Skip to content

Commit 31eaa87

Browse files
committed
fix typings, add codegen to build script
1 parent 75bdd4a commit 31eaa87

File tree

3 files changed

+2341
-25
lines changed

3 files changed

+2341
-25
lines changed

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,22 @@
88
"schema"
99
],
1010
"scripts": {
11-
"prepare": "npm run build; cp src/schema.graphql dist/schema.graphql",
12-
"build": "rm -rf dist && tsc -d",
11+
"prepare": "npm run build && cp src/schema.graphql dist/schema.graphql",
12+
"build": "rm -rf dist && graphql codegen && tsc -d",
1313
"test": "echo No tests yet"
1414
},
1515
"dependencies": {
1616
"apollo-link": "1.2.2",
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.22",
20+
"graphql-binding": "1.4.0-beta.23",
2121
"graphql-tools": "2.23.1"
2222
},
2323
"devDependencies": {
2424
"@types/graphql": "0.13.0",
2525
"@types/node": "9.6.11",
26+
"graphql-cli": "^2.16.0-beta.6",
2627
"typescript": "2.8.3"
2728
},
2829
"repository": {

src/generated-binding.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { makeBindingClass } from 'graphql-binding'
2-
import { GraphQLResolveInfo } from 'graphql'
1+
import { makeBindingClass, Options } from 'graphql-binding'
2+
import { GraphQLResolveInfo, GraphQLSchema } from 'graphql'
3+
import { IResolvers } from 'graphql-tools/dist/Interfaces'
34
import schema from './schema'
45

56
export interface Query {
@@ -66,6 +67,13 @@ export interface BindingInstance {
6667
mutation: Mutation
6768
subscription: Subscription
6869
request: <T = any>(query: string, variables?: {[key: string]: any}) => Promise<T>
70+
delegate(operation: 'query' | 'mutation', fieldName: string, args: {
71+
[key: string]: any;
72+
}, infoOrQuery?: GraphQLResolveInfo | string, options?: Options): Promise<any>;
73+
delegateSubscription(fieldName: string, args?: {
74+
[key: string]: any;
75+
}, infoOrQuery?: GraphQLResolveInfo | string, options?: Options): Promise<AsyncIterator<any>>;
76+
getAbstractResolvers(filterSchema?: GraphQLSchema | string): IResolvers;
6977
}
7078

7179
export interface BindingConstructor<T> {

0 commit comments

Comments
 (0)