Skip to content

Commit 4fe16a8

Browse files
unicodeveloperpeggyrayzis
authored andcommitted
I need to know the schema versioning workflow
1 parent 8c49f7c commit 4fe16a8

1 file changed

Lines changed: 31 additions & 6 deletions

File tree

docs/source/resources/graphql-glossary.md

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ When you start diving into the GraphQL ecosystem, you'll probably encounter some
4343
}
4444
```
4545

46+
`admin` and `managers` are aliases in the example query above.
47+
4648
<h2 id="data-source">Data Source</h2>
4749
<p>A class that encapsulates fetching data from a particular service, with built-in support for caching, deduplication, and error handling.</p>
4850

@@ -63,7 +65,14 @@ query NewsFeed {
6365
```
6466

6567
<h2 id="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+
```
6776

6877
<h2 id="docstring">Docstring</h2>
6978
<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 {
105114
}
106115
```
107116

108-
`id`, `firstName`, and `lastName` are fields in the example above.
117+
`id`, `firstName`, and `lastName` are fields in the Author type above.
109118

110119

111120
<h2 id="fragment">Fragment</h2>
@@ -221,13 +230,13 @@ query getHuman {
221230
`AddTodo` and `getHuman` are names for the mutation and query operation respectively.
222231

223232
<h2 id="partial-query-caching">Partial query caching</h2>
224-
<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>
225234

226235
<h2 id="query">Query</h2>
227236
<p>A read-only fetch operation to request data from a GraphQL service.</p>
228237

229238
<h2 id="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>
231240

232241
```js
233242
const GET_DOG_PHOTO = gql`
@@ -255,7 +264,23 @@ export const queryComponent = `const DogPhoto = ({ breed }) => (
255264
<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>
256265

257266
<h2 id="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+
const resolvers = {
272+
Query: {
273+
author(root, args, context, info) {
274+
return find(authors, { id: args.id });
275+
},
276+
},
277+
Author: {
278+
books(author) {
279+
return filter(books, { author: author.name });
280+
},
281+
},
282+
};
283+
```
259284

260285

261286
<h2 id="schema">Schema</h2>
@@ -289,7 +314,7 @@ type Query {
289314

290315

291316
<h2 id="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>
293318

294319

295320
<h2 id="schema-versioning">Schema versioning</h2>

0 commit comments

Comments
 (0)