graphql.github.io icon indicating copy to clipboard operation
graphql.github.io copied to clipboard

Argument need not be optional to have a default value defined

Open gpj1 opened this issue 1 year ago • 3 comments

Closes #

Description

Current documentation about Arguments says that "When an argument is optional, we can define a default value ..." This seems to be misleading because a default value for an argument can be defined irrespective of optional or mandatory argument.

gpj1 avatar May 17 '24 14:05 gpj1

@gpj1 is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar May 17 '24 14:05 vercel[bot]

Interesting nuance; technically you can’t define a default value for a non-optional argument, since an optional argument is one that is either nullable or has a default value, but this is a bit if a circular argument! Thanks for bringing this to our attention, definitely feels like the wording could be cleaned up 👍

benjie avatar May 18 '24 02:05 benjie