Skip to content

RFC: Client Controlled Nullability #895

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

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
introduce modified field types
  • Loading branch information
twof committed Mar 15, 2022
commit 432555d37a8ccf9054ed34982760cf46413aa4e7
28 changes: 20 additions & 8 deletions spec/Section 6 -- Execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,14 +568,26 @@ set or coercing a scalar value.

ExecuteField(objectType, objectValue, fieldType, fields, variableValues):

- Let {field} be the first entry in {fields}.
- Let {fieldName} be the field name of {field}.
- Let {argumentValues} be the result of {CoerceArgumentValues(objectType, field,
variableValues)}
- Let {resolvedValue} be {ResolveFieldValue(objectType, objectValue, fieldName,
argumentValues)}.
- Return the result of {CompleteValue(fieldType, fields, resolvedValue,
variableValues)}.
- Let {field} be the first entry in {fields}.
- Let {fieldName} be the field name of {field}.
- Let {requiredStatus} be the required status of {field}.
- Let {argumentValues} be the result of {CoerceArgumentValues(objectType, field, variableValues)}
- Let {resolvedValue} be {ResolveFieldValue(objectType, objectValue, fieldName, argumentValues)}.
- Let {modifiedFieldType} be {ModifiedOutputType(fieldType, requiredStatus)}.
- Return the result of {CompleteValue(modifiedFieldType, fields, resolvedValue, variableValues)}.

ModifiedOutputType(outputType, requiredStatus):

- If {requiredStatus} is 'required' and {outputType} is not a Non-Nullable type:
- Return Non-Null with an inner type of {outputType}.
- Otherwise if {requiredStatus} is 'optional':
- If {outputType} is not a Non-Nullable type:
- Return {outputType}.
- Otherwise if {outputType} is a Non-Nullable type:
- Let {innerOutputType} be the inner type of {outputType}.
- Return {innerOutputType}.
- Otherwise:
- Return {outputType}.

### Coercing Field Arguments

Expand Down