From 08e6253bc20885f063d2ebe04c94fc9c62a4142f Mon Sep 17 00:00:00 2001 From: Lee Byron Date: Thu, 7 Dec 2017 13:44:14 -0800 Subject: [PATCH] Improve aggreate NullableType and InputType flow types Mirrors the structure of OutputType flow type, reduces the use of `*`. --- src/type/definition.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/type/definition.js b/src/type/definition.js index 40eb5c43e8..19ca14542a 100644 --- a/src/type/definition.js +++ b/src/type/definition.js @@ -67,18 +67,17 @@ export function assertType(type: mixed): GraphQLType { /** * These types may be used as input types for arguments and directives. */ -type GraphQLInputType_ = +export type GraphQLInputType = | GraphQLScalarType | GraphQLEnumType | GraphQLInputObjectType - | GraphQLList + | GraphQLList | GraphQLNonNull< | GraphQLScalarType | GraphQLEnumType | GraphQLInputObjectType - | GraphQLList, + | GraphQLList, >; -export type GraphQLInputType = GraphQLInputType_<*>; export function isInputType(type: ?GraphQLType): boolean %checks { return ( @@ -200,15 +199,14 @@ export function assertAbstractType(type: ?GraphQLType): GraphQLAbstractType { /** * These types can all accept null as a value. */ -type GraphQLNullableType_ = +export type GraphQLNullableType = | GraphQLScalarType | GraphQLObjectType | GraphQLInterfaceType | GraphQLUnionType | GraphQLEnumType | GraphQLInputObjectType - | GraphQLList; -export type GraphQLNullableType = GraphQLNullableType_<*>; + | GraphQLList<*>; export function getNullableType( type: ?T,