Skip to content

Commit

Permalink
Convert type definitions subtypes to be exact
Browse files Browse the repository at this point in the history
In preparation for graphql#1527
  • Loading branch information
IvanGoncharov committed Aug 12, 2019
1 parent f85d9b6 commit 4049829
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/type/definition.js
Expand Up @@ -895,7 +895,7 @@ export type GraphQLField<
TSource,
TContext,
TArgs = { [argument: string]: any, ... },
> = {
> = {|
name: string,
description: ?string,
type: GraphQLOutputType,
Expand All @@ -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;
Expand Down Expand Up @@ -1273,15 +1271,14 @@ export type GraphQLEnumValueConfig /* <T> */ = {|
astNode?: ?EnumValueDefinitionNode,
|};

export type GraphQLEnumValue /* <T> */ = {
export type GraphQLEnumValue /* <T> */ = {|
name: string,
description: ?string,
isDeprecated?: boolean,
deprecationReason: ?string,
astNode?: ?EnumValueDefinitionNode,
value: any /* T */,
...
};
|};

/**
* Input Object Type Definition
Expand Down Expand Up @@ -1392,14 +1389,13 @@ export type GraphQLInputFieldConfig = {|

export type GraphQLInputFieldConfigMap = ObjMap<GraphQLInputFieldConfig>;

export type GraphQLInputField = {
export type GraphQLInputField = {|
name: string,
type: GraphQLInputType,
defaultValue?: mixed,
description?: ?string,
astNode?: ?InputValueDefinitionNode,
...
};
|};

export function isRequiredInputField(
field: GraphQLInputField,
Expand Down

0 comments on commit 4049829

Please sign in to comment.