Skip to content

Commit 649c3ed

Browse files
committed
Merge branch 'davide-ganito-patch-1'
2 parents 7422cfe + 979ce06 commit 649c3ed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/node/node.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ export function fromGlobalId(globalId: string): ResolvedGlobalId {
109109
*/
110110
export function globalIdField(
111111
typeName?: ?string,
112-
idFetcher?: (object: any) => string
112+
idFetcher?: (object: any, info: GraphQLResolveInfo) => string
113113
): GraphQLFieldConfig {
114114
return {
115115
name: 'id',
116116
description: 'The ID of an object',
117117
type: new GraphQLNonNull(GraphQLID),
118-
resolve: (obj, args, {parentType}) => toGlobalId(
119-
typeName != null ? typeName : parentType.name,
120-
idFetcher ? idFetcher(obj) : obj.id
118+
resolve: (obj, args, info) => toGlobalId(
119+
typeName != null ? typeName : info.parentType.name,
120+
idFetcher ? idFetcher(obj, info) : obj.id
121121
)
122122
};
123123
}

0 commit comments

Comments
 (0)