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 Sep 12, 2024
1 parent e546aac commit a5d7731
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 @@ -656,6 +656,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 @@ -666,7 +672,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 a5d7731

Please sign in to comment.