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 Dec 7, 2023
1 parent 56d6107 commit de763b8
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions spec/Section 6 -- Execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,23 +644,27 @@ must only allow usage of variables of appropriate types.
While nearly all of GraphQL execution can be described generically, ultimately
the internal system exposing the GraphQL interface must provide values. This is
exposed via {ResolveFieldValue}, which produces a value for a given field on a
type for a real value.
type for a real value. 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.

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
determining the resolved value of a field named {fieldName}.
- Return the result of calling {resolver}, providing {objectValue} and
{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.
{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. 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 de763b8

Please sign in to comment.