-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RFC: Fix ambiguity with null variable values and default values (#418)
This change corresponds to a spec proposal (#418) which solves an ambiguity in how variable values and default values behave with explicit null values, and changes validation rules to better define the behavior of default values. Otherwise, this ambiguity can allows for null values to appear in non-null argument values, which may result in unforeseen null-pointer-errors. In summary this change includes: * Removal of `VariablesDefaultValueAllowed` validation rule. All variables may now specify a default value. * Change to `VariablesInAllowedPosition` rule to explicitly not allow a `null` default value when flowing into a non-null argument, and now allows optional (nullable) variables in non-null arguments that provide default values. * Changes to `ProvidedRequiredArguments` rule (renamed from `ProvidedNonNullArguments`) to no longer require values to be provided to non-null arguments which provide a default value. * Changes to `getVariableValues()` and `getArgumentValues()` to ensure a `null` value never flows into a non-null argument. * Changes to `valueFromAST()` to ensure `null` variable values do not flow into non-null types. * Adds to the `TypeInfo` API to allow referencing the expected default value at a given AST position.
- Loading branch information
Showing
3 changed files
with
188 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.