Skip to content

Commit

Permalink
Clarify execution section.
Browse files Browse the repository at this point in the history
This adds algorithms to the section on execution and reorders content to better follow the flow of execution.

Note that no additional semantics are being introduced in this PR. This is simply algorithmic clarification of the execution process.
  • Loading branch information
leebyron committed Oct 21, 2016
1 parent fdff997 commit 748413f
Show file tree
Hide file tree
Showing 2 changed files with 314 additions and 130 deletions.
27 changes: 20 additions & 7 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -775,13 +775,26 @@ An input object is never a valid result.

**Input Coercion**

The input to an input object should be an unordered map, otherwise an error
should be thrown. The result of the coercion is an unordered map, with an
entry for each input field, whose key is the name of the input field.
The value of an entry in the coerced map is the result of input coercing the
value of the entry in the input with the same key; if the input does not have a
corresponding entry, the value is the result of coercing null. The input
coercion above should be performed according to the input coercion rules of the
The value for an input object should be an input object literal or an unordered
map, otherwise an error should be thrown. This unordered map should not contain
any entries with names not defined by a field of this input object type,
otherwise an error should be thrown.

If any non-nullable fields defined by the input object do not have corresponding
entries in the original value, were provided a variable for which a value was
not provided, or for which the value {null} was provided, an error should
be thrown.

The result of coercion is an environment-specific unordered map defining slots
for each field of the input object type.

For each field of the input object type, if the original value has an entry with
the same name, and the value at that entry is a literal value or a variable
which was provided a runtime value, an entry is added to the result with the
name of the field.

The value of that entry in the result is the outcome of input coercing the
original entry value according to the input coercion rules of the
type declared by the input field.

#### Input Object type validation
Expand Down
Loading

0 comments on commit 748413f

Please sign in to comment.