Skip to content

Commit

Permalink
fix: no need to mark param optional if default value is given (#2879)
Browse files Browse the repository at this point in the history
  • Loading branch information
saihaj committed Jan 13, 2021
1 parent 661ff1a commit edbe218
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/language/blockString.js
Expand Up @@ -93,8 +93,8 @@ export function getBlockStringIndentation(value: string): number {
*/
export function printBlockString(
value: string,
indentation?: string = '',
preferMultipleLines?: boolean = false,
indentation: string = '',
preferMultipleLines: boolean = false,
): string {
const isSingleLine = value.indexOf('\n') === -1;
const hasLeadingSpace = value[0] === ' ' || value[0] === '\t';
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/coerceInputValue.js
Expand Up @@ -33,7 +33,7 @@ type OnErrorCB = (
export function coerceInputValue(
inputValue: mixed,
type: GraphQLInputType,
onError?: OnErrorCB = defaultOnError,
onError: OnErrorCB = defaultOnError,
): mixed {
return coerceInputValueImpl(inputValue, type, onError);
}
Expand Down
8 changes: 4 additions & 4 deletions src/validation/validate.js
Expand Up @@ -33,9 +33,9 @@ import { SDLValidationContext, ValidationContext } from './ValidationContext';
export function validate(
schema: GraphQLSchema,
documentAST: DocumentNode,
rules?: $ReadOnlyArray<ValidationRule> = specifiedRules,
typeInfo?: TypeInfo = new TypeInfo(schema),
options?: {| maxErrors?: number |} = { maxErrors: undefined },
rules: $ReadOnlyArray<ValidationRule> = specifiedRules,
typeInfo: TypeInfo = new TypeInfo(schema),
options: {| maxErrors?: number |} = { maxErrors: undefined },
): $ReadOnlyArray<GraphQLError> {
devAssert(documentAST, 'Must provide document.');
// If the schema used for validation is invalid, throw an error.
Expand Down Expand Up @@ -81,7 +81,7 @@ export function validate(
export function validateSDL(
documentAST: DocumentNode,
schemaToExtend?: ?GraphQLSchema,
rules?: $ReadOnlyArray<SDLValidationRule> = specifiedSDLRules,
rules: $ReadOnlyArray<SDLValidationRule> = specifiedSDLRules,
): $ReadOnlyArray<GraphQLError> {
const errors = [];
const context = new SDLValidationContext(
Expand Down

0 comments on commit edbe218

Please sign in to comment.