Skip to content

Commit 8c49f7c

Browse files
unicodeveloperpeggyrayzis
authored andcommitted
Add example of deferred query
1 parent 9e87ad6 commit 8c49f7c

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

docs/source/resources/graphql-glossary.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,20 @@ When you start diving into the GraphQL ecosystem, you'll probably encounter some
4747
<p>A class that encapsulates fetching data from a particular service, with built-in support for caching, deduplication, and error handling.</p>
4848

4949
<h2 id="deferred-query">Deferred query</h2>
50-
<p>A declaration prefixed with an @ character that encapsulates programming logic for query execution on the client or server. There are built-in such as @skip, @include and custom directives. It can be used for features such as authentication, incremental data loading, etc.</p>
50+
<p>A query that has certain fields tagged with the [`@defer` directive](https://www.apollographql.com/docs/react/features/defer-support.html), so that fields that take a long time to resolve do not need to slow down the entire query.</p>
51+
52+
```js
53+
query NewsFeed {
54+
newsFeed {
55+
stories {
56+
text
57+
comments @defer {
58+
text
59+
}
60+
}
61+
}
62+
}
63+
```
5164

5265
<h2 id="directive">Directive</h2>
5366
<p>A declaration prefixed with an @ character that encapsulates programming logic for query execution on the client or server. There are built-in such as @skip, @include and custom directives. It can be used for features such as authentication, incremental data loading, etc.</p>

0 commit comments

Comments
 (0)