Skip to content

Commit

Permalink
Remove Flow workaround for const arguments (#1848)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanGoncharov committed May 3, 2019
1 parent ccbbb29 commit e0fbf90
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 22 deletions.
6 changes: 1 addition & 5 deletions src/type/directives.js
Expand Up @@ -190,10 +190,6 @@ export const specifiedDirectives: $ReadOnlyArray<*> = [
export function isSpecifiedDirective(directive: mixed): boolean %checks {
return (
isDirective(directive) &&
// Would prefer to use specifiedDirectives.some(), however %checks needs
// a simple expression.
(directive.name === GraphQLIncludeDirective.name ||
directive.name === GraphQLSkipDirective.name ||
directive.name === GraphQLDeprecatedDirective.name)
specifiedDirectives.some(({ name }) => name === directive.name)
);
}
11 changes: 1 addition & 10 deletions src/type/introspection.js
Expand Up @@ -487,15 +487,6 @@ export const introspectionTypes: $ReadOnlyArray<*> = [
export function isIntrospectionType(type: mixed): boolean %checks {
return (
isNamedType(type) &&
// Would prefer to use introspectionTypes.some(), however %checks needs
// a simple expression.
(type.name === __Schema.name ||
type.name === __Directive.name ||
type.name === __DirectiveLocation.name ||
type.name === __Type.name ||
type.name === __Field.name ||
type.name === __InputValue.name ||
type.name === __EnumValue.name ||
type.name === __TypeKind.name)
introspectionTypes.some(({ name }) => type.name === name)
);
}
8 changes: 1 addition & 7 deletions src/type/scalars.js
Expand Up @@ -256,12 +256,6 @@ export const specifiedScalarTypes: $ReadOnlyArray<*> = [
export function isSpecifiedScalarType(type: mixed): boolean %checks {
return (
isScalarType(type) &&
// Would prefer to use specifiedScalarTypes.some(), however %checks needs
// a simple expression.
(type.name === GraphQLString.name ||
type.name === GraphQLInt.name ||
type.name === GraphQLFloat.name ||
type.name === GraphQLBoolean.name ||
type.name === GraphQLID.name)
specifiedScalarTypes.some(({ name }) => type.name === name)
);
}

0 comments on commit e0fbf90

Please sign in to comment.