From 9d514189d8744a846f6ce07afe15cb1b232e328d Mon Sep 17 00:00:00 2001 From: Jayavardhana GP Date: Fri, 17 May 2024 20:17:27 +0530 Subject: [PATCH] Argument need not be optional to have a default value defined --- src/pages/learn/schema.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/learn/schema.mdx b/src/pages/learn/schema.mdx index b87c116561..0d7798f4c8 100644 --- a/src/pages/learn/schema.mdx +++ b/src/pages/learn/schema.mdx @@ -63,7 +63,7 @@ type Starship { All arguments are named. Unlike languages like JavaScript and Python where functions take a list of ordered arguments, all arguments in GraphQL are passed by name specifically. In this case, the `length` field has one defined argument, `unit`. -Arguments can be either required or optional. When an argument is optional, we can define a _default value_ - if the `unit` argument is not passed, it will be set to `METER` by default. +Arguments can be either required or optional. We can define a _default value_ for an argument as well - if the `unit` argument is not passed, it will be set to `METER` by default. ## The Query and Mutation types