Skip to content

Commit dd22e50

Browse files
committed
enhance(ResolveFIeldValue): add async collection language
and some baseline collection language for comparison extracted from graphql#742
1 parent 56d6107 commit dd22e50

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

spec/Section 6 -- Execution.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -644,23 +644,27 @@ must only allow usage of variables of appropriate types.
644644
While nearly all of GraphQL execution can be described generically, ultimately
645645
the internal system exposing the GraphQL interface must provide values. This is
646646
exposed via {ResolveFieldValue}, which produces a value for a given field on a
647-
type for a real value.
647+
type for a real value. As an example, this might accept the {objectType}
648+
`Person`, the {field} {"soulMate"}, and the {objectValue} representing John
649+
Lennon. It would be expected to yield the value representing Yoko Ono.
648650

649-
As an example, this might accept the {objectType} `Person`, the {field}
650-
{"soulMate"}, and the {objectValue} representing John Lennon. It would be
651-
expected to yield the value representing Yoko Ono.
651+
List values are resolved similarly. For example, {ResolveFieldValue} might also
652+
accept the {objectType} `MusicBand`, the {field} {"members"}, and the
653+
{objectValue} representing the Beatles. It would be expected to yield a
654+
collection of values representing John Lennon, Paul McCartney, Ringo Starr and
655+
George Harrison.
652656

653657
ResolveFieldValue(objectType, objectValue, fieldName, argumentValues):
654658

655659
- Let {resolver} be the internal function provided by {objectType} for
656660
determining the resolved value of a field named {fieldName}.
657661
- Return the result of calling {resolver}, providing {objectValue} and
658-
{argumentValues}.
659-
660-
Note: It is common for {resolver} to be asynchronous due to relying on reading
661-
an underlying database or networked service to produce a value. This
662-
necessitates the rest of a GraphQL executor to handle an asynchronous execution
663-
flow.
662+
{argumentValues}. Note: It is common for {resolver} to be asynchronous due to
663+
relying on reading an underlying database or networked service to produce a
664+
value. This necessitates the rest of a GraphQL executor to handle an
665+
asynchronous execution flow. In addition, an implementation for collections
666+
may leverage asynchronous iterators or asynchronous generators provided by
667+
many programming languages.
664668

665669
### Value Completion
666670

0 commit comments

Comments
 (0)