Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert type definitions subtypes to be exact #2082

Merged
merged 1 commit into from Aug 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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