Skip to content

Remove Flow workaround for const arguments #1848

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

Merged
merged 1 commit into from
May 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/type/directives.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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)
);
}