Skip to content

Distinguish between undefined and null field argument changed #2386

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

Open
n1ru4l opened this issue Mar 13, 2023 · 0 comments
Open

Distinguish between undefined and null field argument changed #2386

n1ru4l opened this issue Mar 13, 2023 · 0 comments

Comments

@n1ru4l
Copy link
Collaborator

n1ru4l commented Mar 13, 2023

Is your feature request related to a problem? Please describe.

type Dummy {
  field(foo: Boolean): String
}

and

type Dummy {
  field(foo: Boolean = null): String
}

are not the same. Within the resolver you would either get undefined or null for the foo argument value.

This does not only apply to JavaScript land, this also exists in other languages.

Describe the solution you'd like

Setting the default value of a field argument to null should be treated as if the field argument value would be set to another value, which is ChangeType.FieldArgumentDefaultChanged.

Describe alternatives you've considered

None

Additional context

I like turtles

PR with tests: #2387

@dotansimha dotansimha changed the title Distinguish between undefined and null field argument changed Distinguish between undefined and null field argument changed Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant