From 404982958af245d50bec16d7cdd7c1cdf74e110c Mon Sep 17 00:00:00 2001 From: Ivan Goncharov Date: Mon, 12 Aug 2019 15:17:14 +0300 Subject: [PATCH] Convert type definitions subtypes to be exact In preparation for #1527 --- src/type/definition.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/type/definition.js b/src/type/definition.js index f3ab900aa0..ef1f61cb4f 100644 --- a/src/type/definition.js +++ b/src/type/definition.js @@ -895,7 +895,7 @@ export type GraphQLField< TSource, TContext, TArgs = { [argument: string]: any, ... }, -> = { +> = {| name: string, description: ?string, type: GraphQLOutputType, @@ -905,17 +905,15 @@ export type GraphQLField< isDeprecated?: boolean, deprecationReason?: ?string, astNode?: ?FieldDefinitionNode, - ... -}; +|}; -export type GraphQLArgument = { +export type GraphQLArgument = {| name: string, type: GraphQLInputType, defaultValue?: mixed, description?: ?string, astNode?: ?InputValueDefinitionNode, - ... -}; +|}; export function isRequiredArgument(arg: GraphQLArgument): boolean %checks { return isNonNullType(arg.type) && arg.defaultValue === undefined; @@ -1273,15 +1271,14 @@ export type GraphQLEnumValueConfig /* */ = {| astNode?: ?EnumValueDefinitionNode, |}; -export type GraphQLEnumValue /* */ = { +export type GraphQLEnumValue /* */ = {| name: string, description: ?string, isDeprecated?: boolean, deprecationReason: ?string, astNode?: ?EnumValueDefinitionNode, value: any /* T */, - ... -}; +|}; /** * Input Object Type Definition @@ -1392,14 +1389,13 @@ export type GraphQLInputFieldConfig = {| export type GraphQLInputFieldConfigMap = ObjMap; -export type GraphQLInputField = { +export type GraphQLInputField = {| name: string, type: GraphQLInputType, defaultValue?: mixed, description?: ?string, astNode?: ?InputValueDefinitionNode, - ... -}; +|}; export function isRequiredInputField( field: GraphQLInputField,