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
+8-3
Original file line number
Diff line number
Diff line change
@@ -61,7 +61,7 @@ app.listen(4000);
61
61
The `graphqlHTTP` function accepts the following options:
62
62
63
63
***`schema`**: A `GraphQLSchema` instance from [`GraphQL.js`][].
64
-
A `schema`*must* be provided.
64
+
A `schema`*must* be provided.◊
65
65
66
66
***`graphiql`**: If `true`, presents [GraphiQL][] when the GraphQL endpoint is
67
67
loaded in a browser. We recommend that you set
@@ -75,11 +75,16 @@ The `graphqlHTTP` function accepts the following options:
75
75
function from [`GraphQL.js/src/execute.js`](https://github.com/graphql/graphql-js/blob/master/src/execution/execute.js#L122). If `context` is not provided, the
76
76
`request` object is passed as the context.
77
77
78
-
***`pretty`**: If `true`, any JSON response will be pretty-printed.
78
+
***`pretty`**: If `true`, any JSON response will be pretty-printed. When set to `true`, this will override `formatResponse` option.
79
79
80
80
***`formatError`**: An optional function which will be used to format any
81
81
errors produced by fulfilling a GraphQL operation. If no function is
82
-
provided, GraphQL's default spec-compliant [`formatError`][] function will be used.
82
+
provided, GraphQL's default spec-compliant [`formatError`][] function will be used.π
83
+
84
+
***`formatResponse`**: An optional string value to customize the response format. Valid options are:
85
+
`result`, `pretty`, or `json`. The default value is `json`. When specifying `result`, the result data will
86
+
be returned instead of output. Otherwise both `json` and `pretty` will output the appropriate
87
+
response as plain or pretty json respectively.
83
88
84
89
***`extensions`**: An optional function for adding additional metadata to the
85
90
GraphQL response as a key-value object. The result will be added to
0 commit comments