Skip to content

Commit

Permalink
enhance(ResolveFieldValue): add async collection language
Browse files Browse the repository at this point in the history
and some baseline collection language for comparison

extracted from graphql#742

Authored-by: Rob Richard <[email protected]>
  • Loading branch information
yaacovCR committed Feb 13, 2024
1 parent aee03c8 commit 76311e4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spec/Section 6 -- Execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,12 @@ As an example, this might accept the {objectType} `Person`, the {field}
{"soulMate"}, and the {objectValue} representing John Lennon. It would be
expected to yield the value representing Yoko Ono.

List values are resolved similarly. For example, {ResolveFieldValue} might also
accept the {objectType} `MusicBand`, the {field} {"members"}, and the
{objectValue} representing the Beatles. It would be expected to yield a
collection of values representing John Lennon, Paul McCartney, Ringo Starr and
George Harrison.

ResolveFieldValue(objectType, objectValue, fieldName, argumentValues):

- Let {resolver} be the internal function provided by {objectType} for
Expand All @@ -673,7 +679,8 @@ ResolveFieldValue(objectType, objectValue, fieldName, argumentValues):
Note: It is common for {resolver} to be asynchronous due to relying on reading
an underlying database or networked service to produce a value. This
necessitates the rest of a GraphQL executor to handle an asynchronous execution
flow.
flow. In addition, an implementation for collections may leverage asynchronous
iterators or asynchronous generators provided by many programming languages.

### Value Completion

Expand Down

0 comments on commit 76311e4

Please sign in to comment.