Skip to content

Commit

Permalink
Fixed Appendix A Selection Map (#107)
Browse files Browse the repository at this point in the history
* Adds `SelectedListValue` to `SelectedValue` & adds lookahead for `Path`

Resovles: #76, #75

* Allow short hand syntax in `SelectedObjectValue`

Resolves: #74

* Update spec/Appendix A -- Field Selection.md

Co-authored-by: Glen <[email protected]>

* updated the spec text

* fix format

---------

Co-authored-by: Michael Staib <[email protected]>
Co-authored-by: Glen <[email protected]>
  • Loading branch information
3 people authored Feb 6, 2025
1 parent 042623b commit b71c44b
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions spec/Appendix A -- Field Selection.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,17 +385,30 @@ mediaById<Book>.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`.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b71c44b

Please sign in to comment.