Skip to content

Commit edbe218

Browse files
authored
fix: no need to mark param optional if default value is given (#2879)
1 parent 661ff1a commit edbe218

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/language/blockString.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ export function getBlockStringIndentation(value: string): number {
9393
*/
9494
export function printBlockString(
9595
value: string,
96-
indentation?: string = '',
97-
preferMultipleLines?: boolean = false,
96+
indentation: string = '',
97+
preferMultipleLines: boolean = false,
9898
): string {
9999
const isSingleLine = value.indexOf('\n') === -1;
100100
const hasLeadingSpace = value[0] === ' ' || value[0] === '\t';

src/utilities/coerceInputValue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type OnErrorCB = (
3333
export function coerceInputValue(
3434
inputValue: mixed,
3535
type: GraphQLInputType,
36-
onError?: OnErrorCB = defaultOnError,
36+
onError: OnErrorCB = defaultOnError,
3737
): mixed {
3838
return coerceInputValueImpl(inputValue, type, onError);
3939
}

src/validation/validate.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ import { SDLValidationContext, ValidationContext } from './ValidationContext';
3333
export function validate(
3434
schema: GraphQLSchema,
3535
documentAST: DocumentNode,
36-
rules?: $ReadOnlyArray<ValidationRule> = specifiedRules,
37-
typeInfo?: TypeInfo = new TypeInfo(schema),
38-
options?: {| maxErrors?: number |} = { maxErrors: undefined },
36+
rules: $ReadOnlyArray<ValidationRule> = specifiedRules,
37+
typeInfo: TypeInfo = new TypeInfo(schema),
38+
options: {| maxErrors?: number |} = { maxErrors: undefined },
3939
): $ReadOnlyArray<GraphQLError> {
4040
devAssert(documentAST, 'Must provide document.');
4141
// If the schema used for validation is invalid, throw an error.
@@ -81,7 +81,7 @@ export function validate(
8181
export function validateSDL(
8282
documentAST: DocumentNode,
8383
schemaToExtend?: ?GraphQLSchema,
84-
rules?: $ReadOnlyArray<SDLValidationRule> = specifiedSDLRules,
84+
rules: $ReadOnlyArray<SDLValidationRule> = specifiedSDLRules,
8585
): $ReadOnlyArray<GraphQLError> {
8686
const errors = [];
8787
const context = new SDLValidationContext(

0 commit comments

Comments
 (0)