Skip to content

Commit 2cec6f5

Browse files
shannonbuxKyleAMathews
authored andcommitted
Some minor edits (#3586)
* Some minor edits I also think it could be cool to explain just a few use cases that answer this question: "Why is GraphQL so cool?" I also expected to see code examples for image stuff. Also, a random thing about colons that I learned last year is this: a full sentence must precede the colon :) * Tweak
1 parent 53c05d0 commit 2cec6f5

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

docs/docs/querying-with-graphql.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ to you.
1616

1717
Gatsby uses GraphQL to enable [page and layout
1818
components](/docs/building-with-components/) to declare what data they and their
19-
sub-components need. Gatsby then handles making sure that data is available in
19+
sub-components need. Then, Gatsby makes that data available in
2020
the browser when needed by your components.
2121

2222
## What does a GraphQL query look like?
@@ -33,7 +33,7 @@ GraphQL lets you ask for the exact data you need. Queries look like JSON:
3333
}
3434
```
3535

36-
Which returns:
36+
Which returns this:
3737

3838
```json
3939
{
@@ -69,12 +69,12 @@ export const query = graphql`
6969
```
7070
7171
The result of the query is automatically inserted into your React component
72-
on the `data` prop. GraphQL and Gatsby lets you ask for data and then
72+
on the `data` prop. GraphQL and Gatsby let you ask for data and then
7373
immediately start using it.
7474
7575
## How to learn GraphQL
7676
77-
Gatsby might be the first time you've seen GraphQL! We hope you love it as much
77+
Your experience developing with Gatsby might be the first time you've seen GraphQL! We hope you love it as much
7878
as we do and find it useful for all your projects.
7979

8080
When starting out with GraphQL, we recommend the following two tutorials:
@@ -84,18 +84,18 @@ When starting out with GraphQL, we recommend the following two tutorials:
8484

8585
[The official Gatsby tutorial](/tutorial/part-four/) also includes an introduction to using GraphQL specifically with Gatsby.
8686

87-
## How does GraphQL and Gatsby work together?
87+
## How do GraphQL and Gatsby work together?
8888

8989
One of the great things about GraphQL is how flexible it is. People use GraphQL
9090
with [many different programming languages](http://graphql.org/code/) and for web and native apps.
9191

92-
Most people using GraphQL run it on a server to respond live to requests for
92+
Most people run GraphQL on a server to respond live to requests for
9393
data from clients. You define a schema (a schema is a formal way of describing
9494
the shape of your data) for your GraphQL server and then your GraphQL resolvers
9595
retrieve data from databases and/or other APIs.
9696

97-
Gatsby is unique that it uses GraphQL at _build-time_ and _not_ for live
98-
sites. This means you don't need to run additional services (e.g. a database
97+
Gatsby uses GraphQL at _build-time_ and _not_ for live
98+
sites. This is unique, and it means you don't need to run additional services (e.g. a database
9999
and node.js service) to use GraphQL for production websites.
100100
101101
Gatsby is a great framework for building apps so it's possible and encouraged
@@ -106,18 +106,18 @@ a live GraphQL server from the browser.
106106

107107
Most usages of GraphQL involve manually creating a GraphQL schema.
108108

109-
With Gatsby, we instead use plugins which fetch data from different sources
110-
which we use to automatically _infer_ a GraphQL schema.
109+
With Gatsby, we use plugins which fetch data from different sources. We then use that data
110+
to automatically _infer_ a GraphQL schema.
111111

112-
If you give Gatsby data that looks like:
112+
If you give Gatsby data that looks like this:
113113

114114
```json
115115
{
116116
"title": "A long long time ago"
117117
}
118118
```
119119

120-
Gatsby will create a schema that looks something like:
120+
Gatsby will create a schema that looks something like this:
121121

122122
```
123123
title: String
@@ -126,17 +126,16 @@ title: String
126126
This makes it easy to pull data from anywhere and immediately start writing
127127
GraphQL queries against your data.
128128

129-
This _can_ cause confusion though as some data sources allow you to define
130-
a schema but parts of that schema might still not be recreated in Gatsby if
131-
there's not yet any data added for that part of the schema.
129+
This _can_ cause confusion as some data sources allow you to define
130+
a schema even when there's not any data added for parts or all of the schema. If parts of the data haven't been added, then those parts of the schema might not be recreated in Gatsby.
132131

133132
## Powerful data transformations
134133

135-
GraphQL enables another unique feature of Gatsby — it lets you control data transformations with arguments to your queries. Some examples.
134+
GraphQL enables another unique feature of Gatsby — it lets you control data transformations with arguments to your queries. Some examples follow.
136135

137136
### Formatting dates
138137

139-
People often store dates like "2018-01-05" but want to display the date in some other form like "January 5th, 2018". One way of doing this is to load a date formatting JavaScript library into the browser. With Gatsby's GraphQL layer you can instead do the formatting at query time like:
138+
People often store dates like "2018-01-05" but want to display the date in some other form like "January 5th, 2018". One way of doing this is to load a date-formatting JavaScript library into the browser. Or, with Gatsby's GraphQL layer, you can do the formatting at query-time like:
140139
141140
```graphql
142141
{
@@ -146,7 +145,7 @@ People often store dates like "2018-01-05" but want to display the date in some
146145
147146
### Markdown
148147
149-
Gatsby has _transformer_ plugins which can transform data from one form to another. A common example is markdown. If you install [`gatsby-transformer-remark`](/packages/gatsby-transformer-remark/) then in your queries, you can specify you want the transformed HTML version instead of markdown:
148+
Gatsby has _transformer_ plugins which can transform data from one form to another. A common example is markdown. If you install [`gatsby-transformer-remark`](/packages/gatsby-transformer-remark/), then in your queries, you can specify you want the transformed HTML version instead of markdown:
150149
151150
```graphql
152151
markdownRemark {

0 commit comments

Comments
 (0)