Skip to content

Commit 491bcd1

Browse files
committed
docs(readme): fix typo
1 parent 73f9cf5 commit 491bcd1

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

README.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ The second problem solved by FraQL is the mocking. Generating a set of data for
6161

6262
### Reference fragments into components
6363

64-
FraQL exports a default tag function that is a drop-in replacement for `graphql-tag`. By using it you can create easily reusable fragments.
64+
FraQL exports a default tag function that is a drop-in replacement for `graphql-tag`. By using it you can create reusable fragments easily.
6565

66-
FraQL is not a framework, but it is recommended create a static property `fragments` on your components that contains a map of properties. For each one, you can specify the associated fragment.
66+
FraQL is not a framework, but it comes with good practices. It is recommended to create a static property `fragments` on your components that contains a map of component properties. For each one, you specify the associated fragment.
6767

68-
You may have noticed that the fragment uses "\_" as name. FraQL transforms your fragment into an inline fragment, the name is just dropped, using "\_" is just a convention.
68+
You may have noticed that the name of the fragment is "\_". FraQL transforms your fragment into an inline fragment. You can pick any name you want, because it will be dropped the transformation anyway.
6969

7070
```js
7171
import React from 'react'
@@ -78,7 +78,7 @@ const ArticleCard = ({ article }) => (
7878
</div>
7979
)
8080

81-
// Create a map of fragments and reference them on a static property "fragments"
81+
// Create a map of fragments and reference them on a static property "fragments".
8282
ArticleCard.fragments = {
8383
article: gql`
8484
fragment _ on Article {
@@ -93,9 +93,9 @@ export default ArticleCard
9393

9494
### Use fragments into your queries
9595

96-
With FraQL, using a fragment into a query is natural, the only thing to do it to reference it at the place you want to use it.
96+
With FraQL, using a fragment into a query is obvious, just put the fragment where you want to use it.
9797

98-
Importing `gql` from `fraql` is not require for building query. In this case this is just a pass-throught to `graphql-tag`. The magic behind FraQL only happens when you use it on a fragment.
98+
Importing `gql` from `fraql` is not required for queries. In this case this is just a pass-through to `graphql-tag`. The magic behind FraQL only happens when you use it on a fragment.
9999

100100
```js
101101
import React from 'react'
@@ -135,18 +135,18 @@ export default ArticleList
135135

136136
## Mocking
137137

138-
Tools like [StoryBook](https://github.com/storybooks/storybook) permits you to develop your components into an isolated environment. But you still have to generate a set of data for displaying your components. Maintaining this set of data is a pain.
138+
Tools like [StoryBook](https://github.com/storybooks/storybook) allows you to develop your components into an isolated environment. But you still have to write a set of data for displaying your components. Each time you modify your component, you have to modify this set of data, it is a real pain to maintain!
139139

140140
If all your components have fragments, you get mocking for free!
141141

142142
#### 1. Generate introspection
143143

144-
Mocking data from a fragment requires to know all schema types. You have to generate a introspection result from your schema in order to use mocking.
144+
Mocking data from a fragment requires knowing all schema types. That's why you have to generate a introspection result from your schema in order to use mocking.
145145

146-
FraQL exposes a method `introspectSchema` to simplify this operation. The only thing you have to do is creating a script that dump your introspection result into a JSON file.
146+
FraQL exposes a method `introspectSchema` to simplify this operation. The only thing you have to do is create a script that dumps your introspection result into a JSON file.
147147

148148
```js
149-
// Example of script that generate an introspection result into "schema.json"
149+
// Example of script that generates an introspection result into "schema.json".
150150
const { writeFileSync } = require('fs')
151151
const { introspectSchema } = require('fraql/server')
152152
const schema = require('./myGraphQLSchema') // Your schema defined server-side
@@ -157,9 +157,9 @@ fs.writeFileSync('schema.json', JSON.stringify(data))
157157

158158
#### 2. Create a mocker
159159

160-
FraQL exposes a method `createMockerFromIntrospection` that create a mocker from your `schema.json`.
160+
FraQL exposes a method `createMockerFromIntrospection` that creates a mocker from your `schema.json`.
161161

162-
It is recommended to create one mocker and to use it everywhere you need to generate data.
162+
It is recommended to create one mocker and to use it wherever you need to generate data.
163163

164164
```js
165165
// mocker.js
@@ -207,10 +207,10 @@ import gql from 'fraql'
207207
import mocker from './mocker'
208208
import ArticleCard from './ArticleCard'
209209

210-
// Generate all props directly from fragments
210+
// Generate all props directly from fragments.
211211
const props = mocker.mockFragments(ArticleCard.fragments)
212212

213-
// Create a component using props
213+
// Create an element using generated props.
214214
const articleCard = <ArticleCard {...props} />
215215
```
216216

@@ -220,7 +220,7 @@ const articleCard = <ArticleCard {...props} />
220220

221221
### Compose fragments
222222

223-
One of the principle of React is component composition. It is recommended to do the same with your GraphQL fragments. FraQL makes it easy:
223+
One of the principles of React is component composition. It is recommended to do the same with your GraphQL fragments.
224224

225225
```js
226226
// ArticleTitle.js
@@ -267,9 +267,9 @@ export default ArticleCard
267267

268268
### Use without `gql`
269269

270-
FraQL offers a drop-in replacement for `graphql-tag` but sometimes you don't want to use `gql` to define your fragments. As mentioned in [graphql-tag documentation](https://github.com/apollographql/graphql-tag) there is a lot of other ways to do it (using Babel, Webpack, etc..).
270+
FraQL offers a drop-in replacement for `graphql-tag` but sometimes you don't use `gql` to define your fragments. As mentioned in [graphql-tag documentation](https://github.com/apollographql/graphql-tag) there are lots of other ways to do it (using Babel, Webpack, etc..).
271271

272-
FraQL exposes a function `toInlineFragment`, this function transforms a GraphQL fragment into an inline fragment.
272+
FraQL exposes a function `toInlineFragment`, it transforms a GraphQL fragment into an inline fragment.
273273

274274
```js
275275
import { toInlineFragment } from 'fraql'
@@ -289,9 +289,9 @@ const query = gql`
289289

290290
### Mix named and inline fragments
291291

292-
Sometimes you may want to have the best of the two world, use a name fragment in one query and a inline fragment in another.
292+
Sometimes you may want to have the best of the two worlds, use a name fragment in one query and an inline fragment in another.
293293

294-
For this specific use-case FraQL exposes the original document:
294+
For this specific use-case, FraQL exposes the original document:
295295

296296
```js
297297
import gql from 'fraql'
@@ -316,7 +316,7 @@ const query = gql`
316316

317317
### Use custom mocks
318318

319-
Mocking feature of FraQL is build on top of [grapql-tools](https://www.apollographql.com/docs/graphql-tools/), it means you can [customize all mocks](https://www.apollographql.com/docs/graphql-tools/mocking.html#Customizing-mocks).
319+
Mocking feature of FraQL is build on top of [grapql-tools](https://www.apollographql.com/docs/graphql-tools/), it means you can [customize all your mocks](https://www.apollographql.com/docs/graphql-tools/mocking.html#Customizing-mocks).
320320

321321
You can define global mocks when you create the mocker:
322322

@@ -399,7 +399,7 @@ const query = gql`
399399

400400
### `introspectSchema(schema)`
401401

402-
Generate introspection data from a schema.
402+
Generates introspection data from a schema.
403403

404404
```js
405405
import { introspectSchema } from 'fraql/server'
@@ -410,7 +410,7 @@ const introspectionData = introspectSchema(schema)
410410

411411
### `createMockerFromIntrospection(introspectionData, { mocks } = {})`
412412

413-
Generate a mocker from an introspection result generated using `introspectSchema`.
413+
Generates a mocker from an introspection result generated using `introspectSchema`.
414414

415415
You can specify mocks, using [the same format as `graphql-tools`](https://www.apollographql.com/docs/graphql-tools/mocking.html#Customizing-mocks).
416416

@@ -423,7 +423,7 @@ const mocker = createMockerFromIntrospection(introspectionData)
423423

424424
### `mocker.mockFragment(fragment, { mocks } = {})`
425425

426-
Generate mock data from one fragment.
426+
Generates mock data from one fragment.
427427

428428
You can specify mocks, using [the same format as `graphql-tools`](https://www.apollographql.com/docs/graphql-tools/mocking.html#Customizing-mocks).
429429

@@ -440,7 +440,7 @@ const data = fraqlMocker.mockFragment(fragment)
440440

441441
### `mocker.mockFragments(fragments, { mocks } = {})`
442442

443-
Generate mock data from a map of fragments.
443+
Generates mock data from a map of fragments.
444444

445445
You can specify mocks, using [the same format as `graphql-tools`](https://www.apollographql.com/docs/graphql-tools/mocking.html#Customizing-mocks).
446446

0 commit comments

Comments
 (0)