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 <rob@1stdibs.com>
  • Loading branch information
yaacovCR committed Dec 7, 2023
1 parent 56d6107 commit 29e112c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spec/Section 6 -- Execution.md
Expand Up @@ -650,6 +650,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 @@ -660,7 +666,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 29e112c

Please sign in to comment.