From a5d7731baad11657b112251acf03201c24a11d20 Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Thu, 7 Dec 2023 12:51:56 +0200 Subject: [PATCH 1/3] enhance(ResolveFieldValue): add async collection language and some baseline collection language for comparison extracted from #742 Authored-by: Rob Richard --- spec/Section 6 -- Execution.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/Section 6 -- Execution.md b/spec/Section 6 -- Execution.md index 5b8594e30..7e6b16a9b 100644 --- a/spec/Section 6 -- Execution.md +++ b/spec/Section 6 -- Execution.md @@ -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 @@ -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 From 32b7716056caf0f53444a7f70370d24912f26b9c Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Thu, 12 Sep 2024 23:08:05 +0300 Subject: [PATCH 2/3] Update spec/Section 6 -- Execution.md Review feedback --- spec/Section 6 -- Execution.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/Section 6 -- Execution.md b/spec/Section 6 -- Execution.md index 7e6b16a9b..314236aad 100644 --- a/spec/Section 6 -- Execution.md +++ b/spec/Section 6 -- Execution.md @@ -672,8 +672,9 @@ 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. In addition, an implementation for collections may leverage asynchronous -iterators or asynchronous generators provided by many programming languages. +flow. In addition, for fields that have a return type that is a List type, each +value in a collection of values returned by {resolver} may be retrieved +asynchronously. ### Value Completion From 32053c0233d872e36d968a38c85bff7b3bab8a0d Mon Sep 17 00:00:00 2001 From: Yaacov Rydzinski Date: Wed, 18 Sep 2024 22:33:15 +0300 Subject: [PATCH 3/3] PR feedback --- spec/Section 6 -- Execution.md | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/spec/Section 6 -- Execution.md b/spec/Section 6 -- Execution.md index 314236aad..8efd401a4 100644 --- a/spec/Section 6 -- Execution.md +++ b/spec/Section 6 -- Execution.md @@ -656,12 +656,6 @@ 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 @@ -672,9 +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. In addition, for fields that have a return type that is a List type, each -value in a collection of values returned by {resolver} may be retrieved -asynchronously. +flow. If the field is of a list type, each value in the collection of values +returned by {resolver} may itself be retrieved asynchronously. ### Value Completion