Skip to content

Commit 3dd1fc3

Browse files
committed
Update flow types, add test
1 parent 104ab0b commit 3dd1fc3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/node/__tests__/node.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ var photoData = {
4848
};
4949

5050
var {nodeField, nodeInterface} = nodeDefinitions(
51-
(id) => {
51+
(id, info) => {
52+
expect(info.schema).to.equal(schema);
5253
if (userData[id]) {
5354
return userData[id];
5455
}

src/node/node.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import {
1616

1717
import type {
1818
GraphQLFieldConfig,
19-
GraphQLObjectType
19+
GraphQLObjectType,
20+
GraphQLResolveInfo
2021
} from 'graphql';
2122

2223
import {
@@ -39,7 +40,7 @@ type typeResolverFn = (object: any) => ?GraphQLObjectType |
3940
* and a field config for a `node` root field.
4041
*/
4142
export function nodeDefinitions(
42-
idFetcher: ((id: string) => any),
43+
idFetcher: ((id: string, info: GraphQLResolveInfo) => any),
4344
typeResolver: typeResolverFn
4445
): GraphQLNodeDefinitions {
4546
var nodeInterface = new GraphQLInterfaceType({

0 commit comments

Comments
 (0)