From d099d566b07700c13da94ff588a5f8637de2a87d Mon Sep 17 00:00:00 2001 From: Rob Richard Date: Mon, 6 Jul 2020 18:19:46 -0400 Subject: [PATCH] fix build --- spec/Section 3 -- Type System.md | 6 +++++- spec/Section 6 -- Execution.md | 12 +++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/spec/Section 3 -- Type System.md b/spec/Section 3 -- Type System.md index de3576776..785df61a8 100644 --- a/spec/Section 3 -- Type System.md +++ b/spec/Section 3 -- Type System.md @@ -1928,9 +1928,11 @@ type ExampleType { ``` ### @defer + ```graphql directive @defer(label: String, if: Boolean) on FRAGMENT_SPREAD | INLINE_FRAGMENT ``` + The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause @@ -1954,13 +1956,16 @@ fragment someFragment on User { ``` ### @stream + ```graphql directive @stream(label: String, initialCount: Int!, if: Boolean) on FIELD ``` + The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take presedence over `@stream`. + ```graphql example query myQuery($shouldDefer: Boolean) { user { @@ -1969,5 +1974,4 @@ query myQuery($shouldDefer: Boolean) { } } } - ``` diff --git a/spec/Section 6 -- Execution.md b/spec/Section 6 -- Execution.md index 4a6a98fb4..363cf34d3 100644 --- a/spec/Section 6 -- Execution.md +++ b/spec/Section 6 -- Execution.md @@ -578,6 +578,7 @@ DeferFragment(objectType, objectValue, fragmentSelectionSet, parentPath): #### Deferred Fragment Record + **Formal Specification** Let {deferredFragment} be an inline fragment or fragment spread with `@defer` provided. Deferred Fragment Record is a structure containing: @@ -592,7 +593,7 @@ CreateDeferredFragmentRecord(label, objectType, objectValue, fragmentSelectionSe * Construct a deferred fragment record based on the parameters passed in. ResolveDeferredFragmentRecord(deferredFragmentRecord, variableValues, subsequentPayloads): - * Let {label, objectType, objectValue, fragmentSelectionSet, path} be the corresponding fields + * Let {label}, {objectType}, {objectValue}, {fragmentSelectionSet}, {path} be the corresponding fields in the deferred fragment record structure. * Let {payload} be the result of calling {ExecuteSelectionSet(fragmentSelectionSet, objectType, objectValue, variableValues, subsequentPayloads, path)}. * Add an entry to {payload} named `label` with the value {label}. @@ -732,6 +733,7 @@ Unresolved items in the iterator will be stored in a stream record which the exe resumes to execute after the initial execution finishes. #### Stream Record + **Formal Specification** Let {streamField} be a list field with a `@stream` directive provided. A Stream Record is a structure containing: @@ -747,10 +749,10 @@ CreateStreamRecord(label, initialCount, iterator, resolvedItems, index, fields, * Construct a stream record based on the parameters passed in. ResolveStreamRecord(streamRecord, variableValues, subsequentPayloads): -* Let {label, iterator, resolvedItems, index, path, fields, innerType} be the correspondent fields on - the Stream Record structure. -* Remove the first entry from {resolvedItem}, let the entry be {item}. If {resolvedItem} is empty, - retrieve more items from {iterator}: +* Let {label}, {iterator}, {resolvedItems}, {index}, {path}, {fields}, +{innerType} be the correspondent fields on the Stream Record structure. +* Remove the first entry from {resolvedItem}, let the entry be {item}. If +{resolvedItem} is empty, retrieve more items from {iterator}: * Append {index} to {path}. * Increment {index}. * Let {payload} be the result of calling CompleteValue(innerType, fields, item, variableValues, subsequentPayloads, path)}.