Skip to content

Commit b829f21

Browse files
authored
Merge pull request #225 from solon/patch-1
docs(readme): minor spelling & grammar fixes
2 parents 66a237f + a1738c2 commit b829f21

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ Fully-featured GraphQL Server with focus on easy setup, performance & great deve
2929
* Extensible via Express middlewares
3030
* Schema directives
3131
* Apollo Tracing
32-
* Accepts both `application/json` and `application/graphql` content-type
33-
* Runs everywhere: Can be deployed via `now`, `up`, AWS Lambda, Heroku etc
32+
* Accepts both `application/json` and `application/graphql` content-types
33+
* Runs everywhere: Can be deployed via `now`, `up`, AWS Lambda, Heroku etc.
3434

3535
## Install
3636

@@ -86,7 +86,7 @@ The `props` argument accepts the following fields:
8686
> 1. Provide `typeDefs` and `resolvers` and omit the `schema`, in this case `graphql-yoga` will construct the `GraphQLSchema` instance using [`makeExecutableSchema`](https://www.apollographql.com/docs/graphql-tools/generate-schema.html#makeExecutableSchema) from [`graphql-tools`](https://github.com/apollographql/graphql-tools).
8787
> 2. Provide the `schema` directly and omit `typeDefs` and `resolvers`.
8888
89-
> (\*\*) Notice that the `req` argument is an object of the shape `{ request, connection }` which either carries a `request: Request` property (in case it's a `Query`/`Mutation` resolver) or a `connection: SubscriptionOptions` property (in case it's a `Subscription` resolver). [`Request`](http://expressjs.com/en/api.html#req) is imported from Express.js. `SubscriptionOptions` is from the [`graphql-subscriptions`](https://github.com/apollographql/graphql-subscriptions) package. `SubscriptionOptions` are getting the connectionParams automatically injected under `SubscriptionOptions.context.[CONNECTION_PARAMETER_NAME]`
89+
> (\*\*) Notice that the `req` argument is an object of the shape `{ request, connection }` which either carries a `request: Request` property (when it's a `Query`/`Mutation` resolver) or a `connection: SubscriptionOptions` property (when it's a `Subscription` resolver). [`Request`](http://expressjs.com/en/api.html#req) is imported from Express.js. `SubscriptionOptions` is from the [`graphql-subscriptions`](https://github.com/apollographql/graphql-subscriptions) package. `SubscriptionOptions` are getting the `connectionParams` automatically injected under `SubscriptionOptions.context.[CONNECTION_PARAMETER_NAME]`
9090
9191
Here is example of creating a new server:
9292

@@ -108,14 +108,14 @@ const server = new GraphQLServer({ typeDefs, resolvers })
108108

109109
#### `start(options: Options, callback: ((options: Options) => void) = (() => null)): Promise<void>`
110110

111-
Once your `GraphQLServer` is instantiated, you can call the `start` method on it. It takes two arguments: `options`, the options object defined above, and `callback`, a function that's invoked right before the server is started. As an example, the `callback` can be used to print information that the server was now started.
111+
Once your `GraphQLServer` is instantiated, you can call the `start` method on it. It takes two arguments: `options`, the options object defined above, and `callback`, a function that's invoked right before the server is started. As an example, the `callback` can be used to print information that the server has started.
112112

113113
The `options` object has the following fields:
114114

115115
| Key | Type | Default | Note |
116116
| --- | --- | --- | --- |
117117
| `cors` | Object | `null` | Contains [configuration options](https://github.com/expressjs/cors#configuration-options) for [cors](https://github.com/expressjs/cors) |
118-
| `tracing` | Boolean or String | `'http-header'` | Indicates whether [Apollo Tracing](https://github.com/apollographql/apollo-tracing) should be en- or disabled for your server (if a string is provided, accepted values are: `'enabled'`, `'disabled'`, `'http-header'`) |
118+
| `tracing` | Boolean or String | `'http-header'` | Indicates whether [Apollo Tracing](https://github.com/apollographql/apollo-tracing) should be enabled or disabled for your server (if a string is provided, accepted values are: `'enabled'`, `'disabled'`, `'http-header'`) |
119119
| `port` | Number | `4000` | Determines the port your server will be listening on (note that you can also specify the port by setting the `PORT` environment variable) |
120120
| `endpoint` | String | `'/'` | Defines the HTTP endpoint of your server |
121121
| `subscriptions` | Object or String or `false` | `'/'` | Defines the subscriptions (websocket) endpoint for your server; accepts an object with [subscription server options](https://github.com/apollographql/subscriptions-transport-ws#constructoroptions-socketoptions) `path`, `keepAlive`, `onConnect` and `onDisconnect`; setting to `false` disables subscriptions completely |
@@ -131,9 +131,9 @@ Additionally, the `options` object exposes these `apollo-server` options:
131131
| `formatError` | Number | A function to apply to every error before sending the response to clients |
132132
| `logFunction` | LogFunction | A function called for logging events such as execution times |
133133
| `rootValue` | any | RootValue passed to GraphQL execution |
134-
| `validationRules` | Array of functions | DAdditional GraphQL validation rules to be applied to client-specified queries |
135-
| `fieldResolver` | GraphQLFieldResolver | Specifify a custom default field resolver function
136-
| `formatParams` | Function | A function applied for each query in a batch to format parameters before execution |
134+
| `validationRules` | Array of functions | Additional GraphQL validation rules to be applied to client-specified queries |
135+
| `fieldResolver` | GraphQLFieldResolver | Specify a custom default field resolver function
136+
| `formatParams` | Function | A function applied to each query in a batch to format parameters before execution |
137137
| `formatResponse` | Function | A function applied to each response after execution |
138138
| `debug` | boolean | Print additional debug logging if execution errors occur |
139139

@@ -159,7 +159,7 @@ See the original documentation in [`graphql-subscriptions`](https://github.com/a
159159
There are three examples demonstrating how to quickly get started with `graphql-yoga`:
160160

161161
- [hello-world](./examples/hello-world): Basic setup for building a schema and allowing for a `hello` query.
162-
- [subscriptions](./examples/subscriptions): Basic setup for using subscriptions with a counter that increments every 2 seconds and triggers a subscriptions.
162+
- [subscriptions](./examples/subscriptions): Basic setup for using subscriptions with a counter that increments every 2 seconds and triggers a subscription.
163163
- [fullstack](./examples/fullstack): Fullstack example based on [`create-react-app`](https://github.com/facebookincubator/create-react-app) demonstrating how to query data from `graphql-yoga` with [Apollo Client 2.0](https://www.apollographql.com/client/).
164164

165165
## Workflow
@@ -183,7 +183,7 @@ To deploy your `graphql-yoga` server with [`now`](https://zeit.co/now), follow t
183183
To deploy your `graphql-yoga` server with [Heroku](https://heroku.com), follow these instructions:
184184

185185
1. Download and install the [Heroku Command Line Interface](https://devcenter.heroku.com/articles/heroku-cli#download-and-install) (previously Heroku Toolbelt)
186-
2. Log In to the Heroku CLI with `heroku login`
186+
2. Log in to the Heroku CLI with `heroku login`
187187
3. Navigate to the root directory of your `graphql-yoga` server
188188
4. Create the Heroku instance by executing `heroku create`
189189
5. Deploy your GraphQL server by executing `git push heroku master`
@@ -196,17 +196,17 @@ To deploy your `graphql-yoga` server with [Heroku](https://heroku.com), follow t
196196

197197
### How does `graphql-yoga` compare to `apollo-server` and other tools?
198198

199-
As mentioned above, `graphql-yoga` is built on top of a variety of other packages, such as `graphql.js`, `express` and `apollo-server`. Each of these provide a certain piece of functionality required for building a GraphQL server.
199+
As mentioned above, `graphql-yoga` is built on top of a variety of other packages, such as `graphql.js`, `express` and `apollo-server`. Each of these provides a certain piece of functionality required for building a GraphQL server.
200200

201-
Using these packages individually incurs overhead in the setup process and requires you to write a lot of boilerplate. `graphql-yoga` abstracts away the initial complexity and required boilerplate and let's you get started quickly with a set of sensible defaults for your server configuration.
201+
Using these packages individually incurs overhead in the setup process and requires you to write a lot of boilerplate. `graphql-yoga` abstracts away the initial complexity and required boilerplate and lets you get started quickly with a set of sensible defaults for your server configuration.
202202

203203
`graphql-yoga` is like [`create-react-app`](https://github.com/facebookincubator/create-react-app) for building GraphQL servers.
204204

205205
### Can't I just setup my own GraphQL server using `express` and `graphql.js`?
206206

207-
`graphql-yoga` is all about convenience and a great "Getting Started"-experience by abstracting away the complexity that comes when you're building your own GraphQL from scratch. It's a pragmatic approach to bootstrap a GraphQL server, much like [`create-react-app`](https://github.com/facebookincubator/create-react-app) removes friction when first starting out with React.
207+
`graphql-yoga` is all about convenience and a great "Getting Started" experience by abstracting away the complexity that comes when you're building your own GraphQL server from scratch. It's a pragmatic approach to bootstrap a GraphQL server, much like how [`create-react-app`](https://github.com/facebookincubator/create-react-app) removes friction when first starting out with React.
208208

209-
Whenever the defaults of `graphql-yoga` are too tight of a corset for you, you can simply _eject_ from it and use the tooling it's build upon - there's no lock-in or any other kind of magic going on preventing you from this.
209+
Whenever the defaults of `graphql-yoga` are too tight a corset for you, you can simply _eject_ from it and use the tooling it's built upon - there's no lock-in or any other kind of magic going on preventing you from doing this.
210210

211211
### How to eject from the standard `express` setup?
212212

0 commit comments

Comments
 (0)