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.
Copy file name to clipboardExpand all lines: README.md
+28-24Lines changed: 28 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -131,20 +131,20 @@ 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
141
-**`websocketClient`**: An optional GraphQL string for websocket client used for subscription, `v0`: subscriptions-transport-ws, `v1`: graphql-ws. Defaults to `v0` if not provided
142
142
143
-
-**`rootValue`**: A value to pass as the `rootValue` to the `graphql()`
144
-
function from [`GraphQL.js/src/execute.js`](https://github.com/graphql/graphql-js/blob/master/src/execution/execute.js#L119).
143
+
-**`rootValue`**: A value to pass as the `rootValue` to the `execute()`
144
+
function from [`GraphQL.js/src/execute.js`](https://github.com/graphql/graphql-js/blob/main/src/execution/execute.js#L129).
145
145
146
-
-**`context`**: A value to pass as the `context` to the `graphql()`
147
-
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
146
+
-**`context`**: A value to pass as the `contextValue` to the `execute()`
147
+
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
148
148
`request` object is passed as the context.
149
149
150
150
-**`pretty`**: If `true`, any JSON response will be pretty-printed.
@@ -156,7 +156,7 @@ The `graphqlHTTP` function accepts the following options:
156
156
of resources consumed. This may be an async function. The function is
157
157
given one object as an argument: `{ document, variables, operationName, result, context }`.
158
158
159
-
-**`validationRules`**: Optional additional validation rules queries must
159
+
-**`validationRules`**: Optional additional validation rules that queries must
160
160
satisfy in addition to those defined by the GraphQL spec.
161
161
162
162
-**`customValidateFn`**: An optional function which will be used to validate
@@ -175,10 +175,6 @@ The `graphqlHTTP` function accepts the following options:
175
175
-**`formatError`**: is deprecated and replaced by `customFormatErrorFn`. It will be
176
176
removed in version 1.0.0.
177
177
178
-
-**`handleRuntimeQueryErrorFn`**: An optional function which can be used to change the status code
179
-
or headers of the response in case of a runtime query error. By default, the status code is set to
180
-
`500`.
181
-
182
178
In addition to an object defining each option, options can also be provided as
183
179
a function (or async function) which returns this options object. This function
184
180
is provided the arguments `(request, response, graphQLParams)` and is called
@@ -213,7 +209,7 @@ the parameters:
213
209
named operations.
214
210
215
211
-**`raw`**: If the `graphiql` option is enabled and the `raw` parameter is
216
-
provided raw JSON will always be returned instead of GraphiQL even when
212
+
provided, raw JSON will always be returned instead of GraphiQL even when
217
213
loaded from a browser.
218
214
219
215
GraphQL will first look for each parameter in the query string of a URL:
@@ -222,23 +218,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.
221
+
If not found in the querystring, it will look in the POST request body.
226
222
227
223
If a previous middleware has already parsed the POST body, the `request.body`
228
224
value will be used. Use [`multer`][] or a similar middleware to add support
229
225
for `multipart/form-data` content, which may be useful for GraphQL mutations
230
226
involving uploading files. See an [example using multer](https://github.com/graphql/express-graphql/blob/304b24b993c8f16fffff8d23b0fa4088e690874b/src/__tests__/http-test.js#L674-L741).
231
227
232
-
If the POST body has not yet been parsed, express-graphql will interpret it
228
+
If the POST body has not yet been parsed, `express-graphql` will interpret it
233
229
depending on the provided _Content-Type_ header.
234
230
235
231
-**`application/json`**: the POST body will be parsed as a JSON
236
232
object of parameters.
237
233
238
-
-**`application/x-www-form-urlencoded`**: this POST body will be
234
+
-**`application/x-www-form-urlencoded`**: the POST body will be
239
235
parsed as a url-encoded string of key-value pairs.
240
236
241
-
-**`application/graphql`**: The POST body will be parsed as GraphQL
237
+
-**`application/graphql`**: the POST body will be parsed as GraphQL
242
238
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.
347
341
348
-
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.
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/main/src/validation/rules) in the [graphql-js](https://github.com/graphql/graphql-js) package.
349
343
350
344
```js
351
345
import { GraphQLError } from'graphql';
@@ -375,14 +369,14 @@ application any more secure. Nevertheless, disabling introspection is possible b
@@ -430,7 +424,17 @@ Each release of `express-graphql` will be accompanied by an experimental release
430
424
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/).
435
+
436
+
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.
437
+
438
+
You can find [detailed information here](https://github.com/graphql/graphql-wg/tree/main/membership). If you have issues, please email [operations@graphql.org](mailto:operations@graphql.org).
439
+
440
+
If your company benefits from GraphQL and you would like to provide essential financial support for the systems and people that power our community, please also consider membership in the [GraphQL Foundation](https://foundation.graphql.org/join).
0 commit comments