Skip to content

Commit e878745

Browse files
committed
Stylistic updates following #479
1 parent a5e7409 commit e878745

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

src/language/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/** @flow
1+
/* @flow */
2+
/**
23
* Copyright (c) 2015, Facebook, Inc.
34
* All rights reserved.
45
*

src/language/kinds.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/** @flow
1+
/* @flow */
2+
/**
23
* Copyright (c) 2015, Facebook, Inc.
34
* All rights reserved.
45
*

src/type/schema.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,20 +256,27 @@ function typeMapReducer(map: TypeMap, type: ?GraphQLType): TypeMap {
256256
}
257257

258258
if (type instanceof GraphQLObjectType ||
259-
type instanceof GraphQLInterfaceType ||
260-
type instanceof GraphQLInputObjectType) {
259+
type instanceof GraphQLInterfaceType) {
261260
const fieldMap = type.getFields();
262261
Object.keys(fieldMap).forEach(fieldName => {
263262
const field = fieldMap[fieldName];
264263

265-
if ((typeof field.args === 'object') && Array.isArray(field.args)) {
264+
if (field.args) {
266265
const fieldArgTypes = field.args.map(arg => arg.type);
267266
reducedMap = fieldArgTypes.reduce(typeMapReducer, reducedMap);
268267
}
269268
reducedMap = typeMapReducer(reducedMap, field.type);
270269
});
271270
}
272271

272+
if (type instanceof GraphQLInputObjectType) {
273+
const fieldMap = type.getFields();
274+
Object.keys(fieldMap).forEach(fieldName => {
275+
const field = fieldMap[fieldName];
276+
reducedMap = typeMapReducer(reducedMap, field.type);
277+
});
278+
}
279+
273280
return reducedMap;
274281
}
275282

src/utilities/isValidJSValue.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ import type { GraphQLInputType } from '../type/definition';
2727
* accepted for that type. This is primarily useful for validating the
2828
* runtime values of query variables.
2929
*/
30-
export function isValidJSValue(value: mixed, type: GraphQLInputType):
31-
Array<string> {
30+
export function isValidJSValue(
31+
value: mixed,
32+
type: GraphQLInputType
33+
): Array<string> {
3234
// A value must be provided if the type is non-null.
3335
if (type instanceof GraphQLNonNull) {
3436
if (isNullish(value)) {

0 commit comments

Comments
 (0)