Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
robrichard committed Aug 19, 2020
1 parent b670687 commit d099d56
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 5 additions & 1 deletion spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand All @@ -1969,5 +1974,4 @@ query myQuery($shouldDefer: Boolean) {
}
}
}

```
12 changes: 7 additions & 5 deletions spec/Section 6 -- Execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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}.
Expand Down Expand Up @@ -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:
Expand All @@ -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)}.
Expand Down

0 comments on commit d099d56

Please sign in to comment.