You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/resources/graphql-glossary.md
+31-6Lines changed: 31 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,8 @@ When you start diving into the GraphQL ecosystem, you'll probably encounter some
43
43
}
44
44
```
45
45
46
+
`admin` and `managers` are aliases in the example query above.
47
+
46
48
<h2id="data-source">Data Source</h2>
47
49
<p>A class that encapsulates fetching data from a particular service, with built-in support for caching, deduplication, and error handling.</p>
48
50
@@ -63,7 +65,14 @@ query NewsFeed {
63
65
```
64
66
65
67
<h2id="directive">Directive</h2>
66
-
<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>
68
+
<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>
69
+
70
+
```js
71
+
type User @auth {
72
+
name:String!
73
+
banned:Boolean @auth!
74
+
}
75
+
```
67
76
68
77
<h2id="docstring">Docstring</h2>
69
78
<p>It is used for providing descriptions of types, fields and arguments. It adds metadata to a GraphQL document. Docstrings show up in the documentation panel inside GraphQL playground and GraphiQL.</p>
@@ -105,7 +114,7 @@ type Author {
105
114
}
106
115
```
107
116
108
-
`id`, `firstName`, and `lastName` are fields in the example above.
117
+
`id`, `firstName`, and `lastName` are fields in the Author type above.
109
118
110
119
111
120
<h2id="fragment">Fragment</h2>
@@ -221,13 +230,13 @@ query getHuman {
221
230
`AddTodo` and `getHuman` are names for the mutation and query operation respectively.
<p>A technique for caching inputs to GraphQL queries. This type of caching ensures that if the query is slightly different but with the same inputs, those inputs can simply be retrieved from the cache instead of fetching data again from the backend. It is implemented in Apollo Server 2 as Data Source caching.</p>
233
+
<p>A technique for caching inputs to GraphQL queries. This type of caching ensures that if the query is slightly different but with the same inputs, those inputs can simply be retrieved from the cache instead of fetching data again from the backend. It is implemented in Apollo Server 2 as [Data Source](https://www.apollographql.com/docs/apollo-server/features/data-sources.html) caching.</p>
225
234
226
235
<h2id="query">Query</h2>
227
236
<p>A read-only fetch operation to request data from a GraphQL service.</p>
228
237
229
238
<h2id="query-colocation">Query colocation</h2>
230
-
<p>A practice of placing a GraphQL query in the same location as the app component's view logic.</p>
239
+
<p>A practice of placing a GraphQL query in the same location as the app component's view logic. Query co-location makes it easier to facilitate a smooth UI and chore of data retrieval. Jumping directly to the query and keeping the component in sync with its data dependencies is a bliss.</p>
<p>A technique for preventing unwanted attacks by maintaining a list of approved queries that are allowed in your application. Any query not present in the list that is run against the server will not be allowed. [Automatic Persisted Queries](../guides/performance.html#automatic-persisted-queries) is a feature of Apollo Server 2 that enables query whitelisting and persisted queries.</p>
256
265
257
266
<h2id="resolver">Resolver</h2>
258
-
<p>A function that connects schema fields and types to various backends. It can retrieve or write data from either an SQL, a No-SQL, graph database, a micro-service or a REST API.</p>
267
+
<p>A function that connects schema fields and types to various backends. Resolvers provide the instructions for turning a GraphQL operation into data. It can retrieve or write data from either an SQL, a No-SQL, graph database, a micro-service or a REST API. Resolvers can also return strings, ints, null, etc.</p>
268
+
269
+
```js
270
+
...
271
+
constresolvers= {
272
+
Query: {
273
+
author(root, args, context, info) {
274
+
returnfind(authors, { id:args.id });
275
+
},
276
+
},
277
+
Author: {
278
+
books(author) {
279
+
returnfilter(books, { author:author.name });
280
+
},
281
+
},
282
+
};
283
+
```
259
284
260
285
261
286
<h2id="schema">Schema</h2>
@@ -289,7 +314,7 @@ type Query {
289
314
290
315
291
316
<h2id="schema-registry">Schema registry</h2>
292
-
<p>A central database that enables schema registration, tracking of detailed schema changes e.g. types added, fields added, fields deprecated and looking up previous versions of schema.</p>
317
+
<p>A central source of truth for your schema in Apollo Engine. It enables schema registration, schema validation, tracking of detailed schema changes e.g. types added, fields added, fields deprecated and looking up previous versions of schema.</p>
0 commit comments