Skip to content

Commit d5e853a

Browse files
Merge branch 'master' into unresolved-entity
2 parents 44f2ab9 + 7d6f234 commit d5e853a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+5283
-4769
lines changed

docs/package-lock.json

Lines changed: 1570 additions & 3329 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"serve": "gatsby serve"
77
},
88
"dependencies": {
9-
"gatsby": "2.21.9",
10-
"gatsby-theme-apollo-docs": "4.2.2",
9+
"gatsby": "2.22.9",
10+
"gatsby-theme-apollo-docs": "4.2.3",
1111
"react": "16.13.1",
1212
"react-dom": "16.13.1"
1313
}

docs/source/data/resolvers.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ type Query {
198198
Here's a valid query against that schema:
199199

200200
```graphql
201-
query {
201+
query GetBooksByLibrary {
202202
libraries {
203203
books {
204204
author {
@@ -325,7 +325,7 @@ server.listen().then(({ url }) => {
325325
If we now update our query to also ask for each book's `title`:
326326

327327
```graphql{4}
328-
query {
328+
query GetBooksByLibrary {
329329
libraries {
330330
books {
331331
title

docs/source/federation/entities.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ extend type Product @key(fields: "upc") {
182182
Similar to the `reviews` relationship example above, the gateway fetches the required `upc` field from the `products` service and passes it to the `inventory` service, even if the query didn't ask for the `upc`:
183183

184184
```graphql
185-
query {
185+
query GetTopProductAvailability {
186186
topProducts {
187187
inStock
188188
}

docs/source/federation/federation-spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Queries across service boundaries will start off from the `_entities` root field
122122
For example, if we execute a query for the top product's `reviews`:
123123

124124
```graphql
125-
query {
125+
query GetTopProductReviews {
126126
topProducts {
127127
reviews {
128128
body

docs/source/federation/gateway.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ directive @uppercase on FIELD
257257
And here's an example of a query that uses that directive:
258258

259259
```graphql
260-
query {
260+
query GetUppercaseUsernames {
261261
users {
262262
name @uppercase
263263
}

docs/source/federation/introduction.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ were implemented as a single, monolithic service:
189189

190190
```graphql
191191
# A query that the gateway resolves by calling all three services
192-
query {
192+
query GetCurrentUserReviews {
193193
me {
194194
username
195195
reviews {

docs/source/schema/scalars-enums.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,15 @@ type Query {
237237
A query might look like this:
238238

239239
```graphql
240-
query {
240+
query GetAvatar {
241241
avatar(borderColor: RED)
242242
}
243243
```
244244

245245
To pass the enum value as a variable, use a string of JSON, like so:
246246

247247
```graphql
248-
query MyAvatar($color: AllowedColor) {
248+
query GetAvatar($color: AllowedColor) {
249249
avatar(borderColor: $color)
250250
}
251251
```

docs/source/schema/schema.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,18 @@ type Author {
7676

7777
### The `Query` type
7878

79-
The `Query` type defines exactly which GraphQL queries (i.e., read operations) clients can execute against your data graph. It resembles an [object type](#object-types), but its name is always `Query`.
79+
The `Query` type defines all of the top-level **entry points** for queries that clients execute against your data graph. It resembles an [object type](#object-types), but its name is always `Query`.
8080

81-
Each field of the `Query` type defines the name and return type of a different supported query. The `Query` type for our example schema might resemble the following:
81+
Each field of the `Query` type defines the name and return type of a different entry point. The `Query` type for our example schema might resemble the following:
8282

8383
```graphql
8484
type Query {
85-
getBooks: [Book]
86-
getAuthors: [Author]
85+
books: [Book]
86+
authors: [Author]
8787
}
8888
```
8989

90-
This `Query` type defines two available queries: `getBooks` and `getAuthors`. Each query returns a list of the corresponding type.
90+
This `Query` type defines two fields: `books` and `authors`. Each field returns a list of the corresponding type.
9191

9292
With a REST-based API, books and authors would probably be returned by different endpoints (e.g., `/api/books` and `/api/authors`). The flexibility of GraphQL enables clients to query both resources with a single request.
9393

@@ -98,12 +98,12 @@ When your clients build queries to execute against your data graph, those querie
9898
Based on our example schema so far, a client could execute the following query, which requests both a list of all book titles _and_ a list of all author names:
9999

100100
```graphql
101-
query {
102-
getBooks {
101+
query GetBooksAndAuthors {
102+
books {
103103
title
104104
}
105105

106-
getAuthors {
106+
authors {
107107
name
108108
}
109109
}
@@ -114,13 +114,13 @@ Our server would then respond to the query with results that match the query's s
114114
```json
115115
{
116116
"data": {
117-
"getBooks": [
117+
"books": [
118118
{
119119
"title": "Jurassic Park"
120120
},
121121
...
122122
],
123-
"getAuthors": [
123+
"authors": [
124124
{
125125
"name": "Michael Crichton"
126126
},
@@ -132,11 +132,11 @@ Our server would then respond to the query with results that match the query's s
132132

133133
Although it might be useful in some cases to fetch these two separate lists, a client would probably prefer to fetch a single list of books, where each book's author is included in the result.
134134

135-
Because our schema's `Book` type has an `author` field of type `Author`, a client could structure their query like so:
135+
Because our schema's `Book` type has an `author` field of type `Author`, a client could instead structure their query like so:
136136

137137
```graphql
138-
query {
139-
getBooks {
138+
query GetBooks {
139+
books {
140140
title
141141
author {
142142
name
@@ -150,7 +150,7 @@ And once again, our server would respond with results that match the query's str
150150
```json
151151
{
152152
"data": {
153-
"getBooks": [
153+
"books": [
154154
{
155155
"title": "Jurassic Park",
156156
"author": {
@@ -165,9 +165,9 @@ And once again, our server would respond with results that match the query's str
165165

166166
### The `Mutation` type
167167

168-
The `Mutation` type is similar in structure and purpose to the [`Query` type](#the-query-type). Whereas the `Query` type defines your data graph's supported _read_ operations, the `Mutation` type defines supported _write_ operations.
168+
The `Mutation` type is similar in structure and purpose to the [`Query` type](#the-query-type). Whereas the `Query` type defines entry points for _read_ operations, the `Mutation` type defines entry points for _write_ operations.
169169

170-
Each field of the `Mutation` type defines the signature and return type of a different mutation. The `Mutation` type for our example schema might resemble the following:
170+
Each field of the `Mutation` type defines the signature and return type of a different entry point. The `Mutation` type for our example schema might resemble the following:
171171

172172
```graphql
173173
type Mutation {
@@ -182,7 +182,7 @@ This `Mutation` type defines a single available mutation, `addBook`. The mutatio
182182
Like queries, mutations match the structure of your schema's type definitions. The following mutation creates a new `Book` and requests certain fields of the created object as a return value:
183183

184184
```graphql
185-
mutation {
185+
mutation CreateBook {
186186
addBook(title: "Fox in Socks", author: "Dr. Seuss") {
187187
title
188188
author {

0 commit comments

Comments
 (0)