diff --git a/spec/Appendix A -- Field Selection.md b/spec/Appendix A -- Field Selection.md index 1fc8621..7336446 100644 --- a/spec/Appendix A -- Field Selection.md +++ b/spec/Appendix A -- Field Selection.md @@ -385,17 +385,30 @@ mediaById.isbn SelectedValue :: -- Path -- SelectedObjectValue +- SelectedValue | SelectedValueEntry +- `|`? SelectedValueEntry + +SelectedValueEntry :: + +- Path [lookahead != `.`] - Path . SelectedObjectValue -- SelectedValue | SelectedValue +- Path SelectedListValue +- SelectedObjectValue + +A {SelectedValue} consists of one or more {SelectedValueEntry} components, which +may be joined by a pipe (`|`) operator to indicate alternative selections based +on type. -A {SelectedValue} is defined as either a {Path} or a {SelectedObjectValue} +Each {SelectedValueEntry} may take one of the following forms: -A {Path} is designed to point to only a single value, although it may reference -multiple fields depending on the return type. To allow selection from different -paths based on type, a {Path} can include multiple paths separated by a pipe -(`|`). +- A {Path} (when not immediately followed by a dot) that is designed to point to + a single value, although it may reference multiple fields depending on its + return type. +- A {Path} immediately followed by a dot and a {SelectedObjectValue} to denote a + nested object selection. +- A {Path} immediately followed by a {SelectedListValue} to denote selection + from a list. +- A standalone {SelectedObjectValue} In the following example, the value could be `title` when referring to a `Book` and `movieTitle` when referring to a `Movie`. @@ -425,6 +438,7 @@ SelectedObjectValue :: SelectedObjectField :: - Name: SelectedValue +- Name {SelectedObjectValue} are unordered lists of keyed input values wrapped in curly-braces `{}`. It has to be used when the expected input type is an object @@ -471,6 +485,7 @@ type Product { SelectedListValue :: - [ SelectedValue ] +- [ SelectedListValue ] A {SelectedListValue} is an ordered list of {SelectedValue} wrapped in square brackets `[]`. It is used to express semantic equivalence between an argument