You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 20, 2023. It is now read-only.
* Fix rootValue option description
The mentioned function should be execute() instead of graphql(). Also,
the branch name and line number have changed.
* Fix context option description
The mentioned function should be execute() instead of graphql() and the
passed property should be contextValue instead of context. Also, the
branch name and line number have changed.
* Remove distracting session middleware from extensions example
Using the session middleware in the extensions example seems unnecessary
and distracting from the extensions example.
* Make list items explaining POST body parsing consistent
* Add missing comma in JSON example
* Improve the readability of some sentences
* Fix some small typos
* Add missing backticks
* Fix branch name in links to graphql-js repo
Copy file name to clipboardExpand all lines: README.md
+17-19Lines changed: 17 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,18 +131,18 @@ The `graphqlHTTP` function accepts the following options:
131
131
132
132
-**`defaultQuery`**: An optional GraphQL string to use when no query
133
133
is provided and no stored query exists from a previous session.
134
-
If undefined is provided, GraphiQL will use its own default query.
134
+
If `undefined` is provided, GraphiQL will use its own default query.
135
135
136
-
-**`headerEditorEnabled`**: An optional boolean which enables the header editor when true.
137
-
Defaults to false.
136
+
-**`headerEditorEnabled`**: An optional boolean which enables the header editor when `true`.
137
+
Defaults to `false`.
138
138
139
139
-**`subscriptionEndpoint`**: An optional GraphQL string contains the WebSocket server url for subscription.
140
140
141
-
-**`rootValue`**: A value to pass as the `rootValue` to the `graphql()`
142
-
function from [`GraphQL.js/src/execute.js`](https://github.com/graphql/graphql-js/blob/master/src/execution/execute.js#L119).
141
+
-**`rootValue`**: A value to pass as the `rootValue` to the `execute()`
142
+
function from [`GraphQL.js/src/execute.js`](https://github.com/graphql/graphql-js/blob/main/src/execution/execute.js#L129).
143
143
144
-
-**`context`**: A value to pass as the `context` to the `graphql()`
145
-
function from [`GraphQL.js/src/execute.js`](https://github.com/graphql/graphql-js/blob/master/src/execution/execute.js#L120). If `context` is not provided, the
144
+
-**`context`**: A value to pass as the `contextValue` to the `execute()`
145
+
function from [`GraphQL.js/src/execute.js`](https://github.com/graphql/graphql-js/blob/main/src/execution/execute.js#L130). If `context` is not provided, the
146
146
`request` object is passed as the context.
147
147
148
148
-**`pretty`**: If `true`, any JSON response will be pretty-printed.
@@ -154,7 +154,7 @@ The `graphqlHTTP` function accepts the following options:
154
154
of resources consumed. This may be an async function. The function is
155
155
given one object as an argument: `{ document, variables, operationName, result, context }`.
156
156
157
-
-**`validationRules`**: Optional additional validation rules queries must
157
+
-**`validationRules`**: Optional additional validation rules that queries must
158
158
satisfy in addition to those defined by the GraphQL spec.
159
159
160
160
-**`customValidateFn`**: An optional function which will be used to validate
@@ -207,7 +207,7 @@ the parameters:
207
207
named operations.
208
208
209
209
-**`raw`**: If the `graphiql` option is enabled and the `raw` parameter is
210
-
provided raw JSON will always be returned instead of GraphiQL even when
210
+
provided, raw JSON will always be returned instead of GraphiQL even when
211
211
loaded from a browser.
212
212
213
213
GraphQL will first look for each parameter in the query string of a URL:
@@ -216,23 +216,23 @@ GraphQL will first look for each parameter in the query string of a URL:
If not found in the query-string, it will look in the POST request body.
219
+
If not found in the querystring, it will look in the POST request body.
220
220
221
221
If a previous middleware has already parsed the POST body, the `request.body`
222
222
value will be used. Use [`multer`][] or a similar middleware to add support
223
223
for `multipart/form-data` content, which may be useful for GraphQL mutations
224
224
involving uploading files. See an [example using multer](https://github.com/graphql/express-graphql/blob/304b24b993c8f16fffff8d23b0fa4088e690874b/src/__tests__/http-test.js#L674-L741).
225
225
226
-
If the POST body has not yet been parsed, express-graphql will interpret it
226
+
If the POST body has not yet been parsed, `express-graphql` will interpret it
227
227
depending on the provided _Content-Type_ header.
228
228
229
229
-**`application/json`**: the POST body will be parsed as a JSON
230
230
object of parameters.
231
231
232
-
-**`application/x-www-form-urlencoded`**: this POST body will be
232
+
-**`application/x-www-form-urlencoded`**: the POST body will be
233
233
parsed as a url-encoded string of key-value pairs.
234
234
235
-
-**`application/graphql`**: The POST body will be parsed as GraphQL
235
+
-**`application/graphql`**: the POST body will be parsed as GraphQL
236
236
query string, which provides the `query` parameter.
GraphQL's [validation phase](https://graphql.github.io/graphql-spec/#sec-Validation) checks the query to ensure that it can be successfully executed against the schema. The `validationRules` option allows for additional rules to be run during this phase. Rules are applied to each node in an AST representing the query using the Visitor pattern.
341
339
342
-
A validation rule is a function which returns a visitor for one or more node Types. Below is an example of a validation preventing the specific field name `metadata` from being queried. For more examples see the [`specifiedRules`](https://github.com/graphql/graphql-js/tree/master/src/validation/rules) in the [graphql-js](https://github.com/graphql/graphql-js) package.
340
+
A validation rule is a function which returns a visitor for one or more node Types. Below is an example of a validation preventing the specific field name `metadata` from being queried. For more examples, see the [`specifiedRules`](https://github.com/graphql/graphql-js/tree/main/src/validation/rules) in the [graphql-js](https://github.com/graphql/graphql-js) package.
343
341
344
342
```js
345
343
import { GraphQLError } from'graphql';
@@ -424,14 +422,14 @@ Each release of `express-graphql` will be accompanied by an experimental release
424
422
Community feedback on this experimental release is much appreciated and can be provided on the [PR for the defer-stream branch](https://github.com/graphql/express-graphql/pull/726) or the [GraphQL.js issue for feedback](https://github.com/graphql/graphql-js/issues/2848).
This repository is managed by EasyCLA. Project participants must sign the free ([GraphQL Specification Membership agreement](https://preview-spec-membership.graphql.org) before making a contribution. You only need to do this one time, and it can be signed by [individual contributors](http://individual-spec-membership.graphql.org/) or their [employers](http://corporate-spec-membership.graphql.org/).
432
+
This repository is managed by EasyCLA. Project participants must sign the free [GraphQL Specification Membership agreement](https://preview-spec-membership.graphql.org) before making a contribution. You only need to do this one time, and it can be signed by [individual contributors](http://individual-spec-membership.graphql.org/) or their [employers](http://corporate-spec-membership.graphql.org/).
435
433
436
434
To initiate the signature process please open a PR against this repo. The EasyCLA bot will block the merge if we still need a membership agreement from you.
0 commit comments