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

fix: no need to mark param optional if default value is given #2879

Merged
merged 1 commit into from Jan 13, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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