Skip to content

Commit 130dfc3

Browse files
committed
Flow type fixes
1 parent 44f303e commit 130dfc3

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/definition.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import type {
99
ResolverMWResolve as _ResolverMWResolve,
1010
ResolverMWOutputTypeFn as _ResolverMWOutputTypeFn,
1111
ResolverMWOutputType as _ResolverMWOutputType,
12+
GraphQLResolveInfo as _GraphQLResolveInfo,
1213
} from 'graphql-compose/lib/definition.js';
1314

1415
export type ResolverMWArgsFn = _ResolverMWArgsFn;
@@ -20,6 +21,7 @@ export type ResolverMWResolve = _ResolverMWResolve;
2021
export type ResolverMWOutputTypeFn = _ResolverMWOutputTypeFn;
2122
export type ResolverMWOutputType = _ResolverMWOutputType;
2223

24+
export type GraphQLResolveInfo = _GraphQLResolveInfo;
2325

2426
import type {
2527
TypeComposer as _TypeComposer,

src/mutationMiddleware.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default class MutationMiddleware extends ResolverMiddleware {
3434

3535
if (nextArgs.input && nextArgs.input.type) {
3636
// pass args unchanged
37+
// $FlowFixMe
3738
inputTC = new InputTypeComposer(getNamedType(nextArgs.input.type));
3839
newNextArgs = nextArgs;
3940
} else {

src/nodeFieldConfig.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from 'graphql';
88
import { fromGlobalId } from './globalId';
99
import NodeInterface from './nodeInterface';
10-
import type { TypeFindByIdMap } from './definition.js';
10+
import type { TypeFindByIdMap, GraphQLResolveInfo } from './definition.js';
1111
import { getProjectionFromAST } from 'graphql-compose';
1212

1313
// this fieldConfig must be set to RootQuery.node field
@@ -21,7 +21,12 @@ export function getNodeFieldConfig(typeToFindByIdMap: TypeFindByIdMap) {
2121
description: 'The globally unique ID among all types',
2222
},
2323
},
24-
resolve: (source: mixed, args: {[argName: string]: mixed}, context: mixed, info: mixed) => {
24+
resolve: (
25+
source: mixed,
26+
args: {[argName: string]: mixed},
27+
context: mixed,
28+
info: GraphQLResolveInfo
29+
) => {
2530
if (!args.id || !(typeof args.id === 'string')) {
2631
return null;
2732
}

0 commit comments

Comments
 (0)