Skip to content

Commit d1a57f5

Browse files
committed
chore(deps): update and migrate
1 parent a51dffb commit d1a57f5

File tree

10 files changed

+858
-490
lines changed

10 files changed

+858
-490
lines changed

docs/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ graphql-http
1414
- [use/express](modules/use_express.md)
1515
- [use/fastify](modules/use_fastify.md)
1616
- [use/fetch](modules/use_fetch.md)
17+
- [use/koa](modules/use_koa.md)
1718
- [use/node](modules/use_node.md)

docs/classes/client.NetworkError.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ you should supply the `Response` generic depending on your Fetch implementation.
4747

4848
| Name | Type |
4949
| :------ | :------ |
50-
| `msgOrErrOrResponse` | `string` \| `Response` \| `Error` |
50+
| `msgOrErrOrResponse` | `string` \| `Error` \| `Response` |
5151

5252
#### Overrides
5353

docs/interfaces/handler.HandlerOptions.md

+7-30
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,8 @@ ___
4646

4747
▸ (`args`): `PromiseOrValue`<`ExecutionResult`\>
4848

49-
Implements the "Executing requests" section of the GraphQL specification.
50-
51-
Returns either a synchronous ExecutionResult (if all encountered resolvers
52-
are synchronous), or a Promise of an ExecutionResult that will eventually be
53-
resolved and never rejected.
54-
55-
If the arguments to this function do not result in a legal execution context,
56-
a GraphQLError will be thrown immediately explaining the invalid input.
49+
Is the `execute` function from GraphQL which is
50+
used to execute the query and mutation operations.
5751

5852
##### Parameters
5953

@@ -75,9 +69,7 @@ ___
7569

7670
▸ (`documentAST`, `operationName?`): `Maybe`<`OperationDefinitionNode`\>
7771

78-
Returns an operation AST given a document AST and optionally an operation
79-
name. If a name is not provided, an operation is only returned if only one is
80-
provided in the document.
72+
GraphQL operation AST getter used for detecting the operation type.
8173

8274
##### Parameters
8375

@@ -182,8 +174,7 @@ ___
182174

183175
▸ (`source`, `options?`): `DocumentNode`
184176

185-
Given a GraphQL source, parses it into a Document.
186-
Throws GraphQLError if a syntax error is encountered.
177+
GraphQL parse function allowing you to apply a custom parser.
187178

188179
##### Parameters
189180

@@ -240,24 +231,10 @@ ___
240231

241232
▸ (`schema`, `documentAST`, `rules?`, `options?`, `typeInfo?`): `ReadonlyArray`<`GraphQLError`\>
242233

243-
Implements the "Validation" section of the spec.
244-
245-
Validation runs synchronously, returning an array of encountered errors, or
246-
an empty array if no errors were encountered and the document is valid.
247-
248-
A list of specific validation rules may be provided. If not provided, the
249-
default list of rules defined by the GraphQL specification will be used.
250-
251-
Each validation rules is a function which returns a visitor
252-
(see the language/visitor API). Visitor methods are expected to return
253-
GraphQLErrors, or Arrays of GraphQLErrors when invalid.
254-
255-
Validate will stop validation after a `maxErrors` limit has been reached.
256-
Attackers can send pathologically invalid queries to induce a DoS attack,
257-
so by default `maxErrors` set to 100 errors.
234+
A custom GraphQL validate function allowing you to apply your
235+
own validation rules.
258236

259-
Optionally a custom TypeInfo instance may be provided. If not provided, one
260-
will be created from the provided schema.
237+
Will not be used when implementing a custom `onSubscribe`.
261238

262239
##### Parameters
263240

docs/interfaces/use_fetch.FetchAPI.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The necessary API from the fetch environment for the handler.
2222

2323
#### Type declaration
2424

25-
**new FetchAPI**(`underlyingSource`, `strategy?`): `ReadableStream`<`Uint8Array`\>
25+
**new ReadableStream**(`underlyingSource`, `strategy?`): `ReadableStream`<`Uint8Array`\>
2626

2727
##### Parameters
2828

@@ -35,7 +35,7 @@ The necessary API from the fetch environment for the handler.
3535

3636
`ReadableStream`<`Uint8Array`\>
3737

38-
**new FetchAPI**<`R`\>(`underlyingSource`, `strategy?`): `ReadableStream`<`R`\>
38+
**new ReadableStream**<`R`\>(`underlyingSource`, `strategy?`): `ReadableStream`<`R`\>
3939

4040
##### Type parameters
4141

@@ -54,7 +54,7 @@ The necessary API from the fetch environment for the handler.
5454

5555
`ReadableStream`<`R`\>
5656

57-
**new FetchAPI**<`R`\>(`underlyingSource?`, `strategy?`): `ReadableStream`<`R`\>
57+
**new ReadableStream**<`R`\>(`underlyingSource?`, `strategy?`): `ReadableStream`<`R`\>
5858

5959
##### Type parameters
6060

@@ -81,7 +81,7 @@ ___
8181

8282
#### Type declaration
8383

84-
**new FetchAPI**(`body?`, `init?`): `Response`
84+
**new Response**(`body?`, `init?`): `Response`
8585

8686
##### Parameters
8787

@@ -102,7 +102,7 @@ ___
102102

103103
#### Type declaration
104104

105-
**new FetchAPI**(): `TextEncoder`
105+
**new TextEncoder**(): `TextEncoder`
106106

107107
##### Returns
108108

docs/modules/use_koa.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[graphql-http](../README.md) / use/koa
2+
3+
# Module: use/koa
4+
5+
## Table of contents
6+
7+
### Functions
8+
9+
- [createHandler](use_koa.md#createhandler)
10+
11+
## Server/koa
12+
13+
### createHandler
14+
15+
**createHandler**<`Context`\>(`options`): `Middleware`
16+
17+
Create a GraphQL over HTTP Protocol compliant request handler for
18+
the Koa framework.
19+
20+
```js
21+
import Koa from 'koa'; // yarn add koa
22+
import mount from 'koa-mount'; // yarn add koa-mount
23+
import { createHandler } from 'graphql-http/lib/use/koa';
24+
import { schema } from './my-graphql-schema';
25+
26+
const app = new Koa();
27+
app.use(mount('/', createHandler({ schema })));
28+
29+
app.listen({ port: 4000 });
30+
console.log('Listening to port 4000');
31+
```
32+
33+
#### Type parameters
34+
35+
| Name | Type |
36+
| :------ | :------ |
37+
| `Context` | extends [`OperationContext`](handler.md#operationcontext) = `undefined` |
38+
39+
#### Parameters
40+
41+
| Name | Type |
42+
| :------ | :------ |
43+
| `options` | [`HandlerOptions`](../interfaces/handler.HandlerOptions.md)<`IncomingMessage`, `undefined`, `Context`\> |
44+
45+
#### Returns
46+
47+
`Middleware`

implementations/apollo-server/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"start": "node ."
88
},
99
"dependencies": {
10-
"@apollo/server": "^4.3.0",
10+
"@apollo/server": "^4.3.1",
1111
"graphql": "^16.6.0"
1212
}
1313
}

implementations/graphql-yoga/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
},
99
"dependencies": {
1010
"graphql": "^16.6.0",
11-
"graphql-yoga": "^3.1.2"
11+
"graphql-yoga": "^3.3.0"
1212
}
1313
}

implementations/mercurius/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"start": "node ."
88
},
99
"dependencies": {
10-
"fastify": "^4.10.2",
10+
"fastify": "^4.11.0",
1111
"graphql": "^16.6.0",
12-
"mercurius": "^11.4.0"
12+
"mercurius": "^11.5.0"
1313
}
1414
}

package.json

+15-15
Original file line numberDiff line numberDiff line change
@@ -95,42 +95,42 @@
9595
"graphql": ">=0.11 <=16"
9696
},
9797
"devDependencies": {
98-
"@babel/core": "^7.20.7",
98+
"@babel/core": "^7.20.12",
9999
"@babel/plugin-proposal-class-properties": "^7.18.6",
100100
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
101101
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
102102
"@babel/plugin-proposal-optional-chaining": "^7.20.7",
103103
"@babel/preset-env": "^7.20.2",
104104
"@babel/preset-typescript": "^7.18.6",
105-
"@rollup/plugin-terser": "^0.2.1",
106-
"@rollup/plugin-typescript": "^10.0.1",
105+
"@rollup/plugin-terser": "^0.3.0",
106+
"@rollup/plugin-typescript": "^11.0.0",
107107
"@semantic-release/changelog": "^6.0.2",
108108
"@semantic-release/git": "^10.0.1",
109109
"@types/eslint": "^8.4.10",
110110
"@types/express": "^4.17.15",
111-
"@types/glob": "^8.0.0",
112-
"@types/jest": "^29.2.4",
111+
"@types/glob": "^8.0.1",
112+
"@types/jest": "^29.2.6",
113113
"@types/koa": "^2.13.5",
114114
"@types/koa-mount": "^4.0.2",
115-
"@typescript-eslint/eslint-plugin": "^5.47.0",
116-
"@typescript-eslint/parser": "^5.47.0",
117-
"@whatwg-node/fetch": "^0.5.3",
115+
"@typescript-eslint/eslint-plugin": "^5.48.2",
116+
"@typescript-eslint/parser": "^5.48.2",
117+
"@whatwg-node/fetch": "^0.6.2",
118118
"babel-jest": "^29.3.1",
119-
"eslint": "^8.30.0",
120-
"eslint-config-prettier": "^8.5.0",
119+
"eslint": "^8.32.0",
120+
"eslint-config-prettier": "^8.6.0",
121121
"express": "^4.18.2",
122-
"fastify": "^4.10.2",
122+
"fastify": "^4.11.0",
123123
"graphql": "^16.6.0",
124124
"jest": "^29.3.1",
125125
"jest-jasmine2": "^29.3.1",
126126
"koa": "^2.14.1",
127127
"koa-mount": "^4.0.0",
128128
"node-fetch": "^3.3.0",
129-
"prettier": "^2.8.1",
130-
"rollup": "^3.8.1",
131-
"semantic-release": "^19.0.5",
129+
"prettier": "^2.8.3",
130+
"rollup": "^3.10.0",
131+
"semantic-release": "^20.0.2",
132132
"tslib": "^2.4.1",
133-
"typedoc": "^0.23.23",
133+
"typedoc": "^0.23.24",
134134
"typedoc-plugin-markdown": "^3.14.0",
135135
"typescript": "^4.9.4"
136136
},

0 commit comments

Comments
 (0)