@tsed/apollo 7.80.2 → 7.81.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/ApolloModule.js +13 -7
- package/lib/cjs/ApolloModule.js.map +1 -1
- package/lib/cjs/constants/constants.js +2 -1
- package/lib/cjs/constants/constants.js.map +1 -1
- package/lib/cjs/decorators/dataSource.js +2 -2
- package/lib/cjs/decorators/injectApolloContext.js +28 -0
- package/lib/cjs/decorators/injectApolloContext.js.map +1 -0
- package/lib/cjs/index.js +5 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interfaces/AlterApolloContext.js +3 -0
- package/lib/cjs/interfaces/AlterApolloContext.js.map +1 -0
- package/lib/cjs/interfaces/AlterApolloServerPlugins.js +3 -0
- package/lib/cjs/interfaces/AlterApolloServerPlugins.js.map +1 -0
- package/lib/cjs/interfaces/AlterApolloSettings.js +3 -0
- package/lib/cjs/interfaces/AlterApolloSettings.js.map +1 -0
- package/lib/cjs/interfaces/ApolloContext.js +3 -0
- package/lib/cjs/interfaces/ApolloContext.js.map +1 -0
- package/lib/cjs/services/ApolloService.js +72 -55
- package/lib/cjs/services/ApolloService.js.map +1 -1
- package/lib/esm/ApolloModule.js +14 -8
- package/lib/esm/ApolloModule.js.map +1 -1
- package/lib/esm/constants/constants.js +1 -0
- package/lib/esm/constants/constants.js.map +1 -1
- package/lib/esm/decorators/dataSource.js +2 -2
- package/lib/esm/decorators/injectApolloContext.js +24 -0
- package/lib/esm/decorators/injectApolloContext.js.map +1 -0
- package/lib/esm/index.js +5 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces/AlterApolloContext.js +2 -0
- package/lib/esm/interfaces/AlterApolloContext.js.map +1 -0
- package/lib/esm/interfaces/AlterApolloServerPlugins.js +2 -0
- package/lib/esm/interfaces/AlterApolloServerPlugins.js.map +1 -0
- package/lib/esm/interfaces/AlterApolloSettings.js +2 -0
- package/lib/esm/interfaces/AlterApolloSettings.js.map +1 -0
- package/lib/esm/interfaces/ApolloContext.js +2 -0
- package/lib/esm/interfaces/ApolloContext.js.map +1 -0
- package/lib/esm/services/ApolloService.js +72 -55
- package/lib/esm/services/ApolloService.js.map +1 -1
- package/lib/types/ApolloModule.d.ts +3 -2
- package/lib/types/constants/constants.d.ts +1 -0
- package/lib/types/decorators/dataSource.d.ts +2 -2
- package/lib/types/decorators/injectApolloContext.d.ts +5 -0
- package/lib/types/index.d.ts +5 -0
- package/lib/types/interfaces/AlterApolloContext.d.ts +5 -0
- package/lib/types/interfaces/AlterApolloServerPlugins.d.ts +5 -0
- package/lib/types/interfaces/AlterApolloSettings.d.ts +7 -0
- package/lib/types/interfaces/ApolloContext.d.ts +4 -0
- package/lib/types/interfaces/ApolloSettings.d.ts +22 -10
- package/lib/types/services/ApolloService.d.ts +18 -14
- package/lib/types-esm/ApolloModule.d.ts +3 -2
- package/lib/types-esm/constants/constants.d.ts +1 -0
- package/lib/types-esm/decorators/dataSource.d.ts +2 -2
- package/lib/types-esm/decorators/injectApolloContext.d.ts +5 -0
- package/lib/types-esm/index.d.ts +5 -0
- package/lib/types-esm/interfaces/AlterApolloContext.d.ts +5 -0
- package/lib/types-esm/interfaces/AlterApolloServerPlugins.d.ts +5 -0
- package/lib/types-esm/interfaces/AlterApolloSettings.d.ts +7 -0
- package/lib/types-esm/interfaces/ApolloContext.d.ts +4 -0
- package/lib/types-esm/interfaces/ApolloSettings.d.ts +22 -10
- package/lib/types-esm/services/ApolloService.d.ts +18 -14
- package/package.json +23 -22
- package/readme.md +1 -24
- package/vitest.config.mts +5 -5
- package/.nycrc +0 -26
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tsed/apollo",
|
|
3
3
|
"description": "Apollo package for Ts.ED framework",
|
|
4
4
|
"type": "commonjs",
|
|
5
|
-
"version": "7.
|
|
5
|
+
"version": "7.81.0-rc.1",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/cjs/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
@@ -26,33 +26,31 @@
|
|
|
26
26
|
"tslib": "2.6.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@tsed/
|
|
29
|
+
"@apollo/datasource-rest": "6.2.2",
|
|
30
|
+
"@apollo/server": "^4.10.4",
|
|
31
|
+
"@as-integrations/koa": "1.1.1",
|
|
32
|
+
"@tsed/barrels": "7.81.0-rc.1",
|
|
33
|
+
"@tsed/common": "7.81.0-rc.1",
|
|
34
|
+
"@tsed/core": "7.81.0-rc.1",
|
|
35
|
+
"@tsed/di": "7.81.0-rc.1",
|
|
33
36
|
"@tsed/logger": ">=6.7.5",
|
|
34
|
-
"@tsed/typescript": "7.
|
|
35
|
-
"
|
|
36
|
-
"apollo-
|
|
37
|
-
"apollo-datasource-rest": "^3.7.0",
|
|
38
|
-
"apollo-server-core": "^3.13.0",
|
|
39
|
-
"apollo-server-express": "^3.13.0",
|
|
40
|
-
"apollo-server-koa": "^3.13.0",
|
|
41
|
-
"apollo-server-testing": "^2.26.2",
|
|
37
|
+
"@tsed/typescript": "7.81.0-rc.1",
|
|
38
|
+
"apollo-datasource-http": "0.21.0",
|
|
39
|
+
"apollo-server-testing": "2.25.3",
|
|
42
40
|
"eslint": "^8.57.0",
|
|
43
|
-
"graphql": "
|
|
41
|
+
"graphql": "16.8.2",
|
|
44
42
|
"typescript": "4.9.5",
|
|
45
43
|
"vitest": "2.0.4"
|
|
46
44
|
},
|
|
47
45
|
"peerDependencies": {
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
46
|
+
"@apollo/datasource-http": "",
|
|
47
|
+
"@apollo/datasource-rest": ">=6.2.2",
|
|
48
|
+
"@apollo/server": ">=4.10.4",
|
|
49
|
+
"@tsed/common": "7.81.0-rc.1",
|
|
50
|
+
"@tsed/core": "7.81.0-rc.1",
|
|
51
|
+
"@tsed/di": "7.81.0-rc.1",
|
|
51
52
|
"@tsed/logger": ">=6.7.5",
|
|
52
|
-
"
|
|
53
|
-
"apollo-datasource-rest": ">=3.0.0",
|
|
54
|
-
"apollo-server-core": ">=3.0.0",
|
|
55
|
-
"graphql": ">15.0.0"
|
|
53
|
+
"graphql": ">16.0.0"
|
|
56
54
|
},
|
|
57
55
|
"repository": "https://github.com/tsedio/tsed",
|
|
58
56
|
"bugs": {
|
|
@@ -60,5 +58,8 @@
|
|
|
60
58
|
},
|
|
61
59
|
"homepage": "https://github.com/tsedio/tsed/tree/production/packages/graphql/apollo",
|
|
62
60
|
"author": "Romain Lenzotti",
|
|
63
|
-
"license": "MIT"
|
|
61
|
+
"license": "MIT",
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"tag": "rc"
|
|
64
|
+
}
|
|
64
65
|
}
|
package/readme.md
CHANGED
|
@@ -45,8 +45,7 @@ If you're looking for integration with TypeGraphQL see the [`@tsed/typegraphql`]
|
|
|
45
45
|
To begin, install the Apollo module for TS.ED:
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
npm install --save @tsed/apollo graphql@15
|
|
49
|
-
npm install --save apollo-datasource apollo-datasource-rest apollo-server-express
|
|
48
|
+
npm install --save @tsed/apollo graphql@15 @apollo/server apollo/datasource-rest
|
|
50
49
|
npm install --save-dev apollo-server-testing
|
|
51
50
|
```
|
|
52
51
|
|
|
@@ -68,28 +67,6 @@ import "@tsed/apollo";
|
|
|
68
67
|
export class Server {}
|
|
69
68
|
```
|
|
70
69
|
|
|
71
|
-
## ApolloService
|
|
72
|
-
|
|
73
|
-
ApolloService let you to retrieve an instance of ApolloServer.
|
|
74
|
-
|
|
75
|
-
```typescript
|
|
76
|
-
import {Injectable, AfterRoutesInit} from "@tsed/common";
|
|
77
|
-
import {graphQLService} from "@tsed/apollo";
|
|
78
|
-
import {ApolloServer} from "apollo-server-express";
|
|
79
|
-
|
|
80
|
-
@Injectable()
|
|
81
|
-
export class UsersService implements AfterRoutesInit {
|
|
82
|
-
@Injec()
|
|
83
|
-
apolloService: ApolloService;
|
|
84
|
-
|
|
85
|
-
private server: ApolloServer;
|
|
86
|
-
|
|
87
|
-
$afterRoutesInit() {
|
|
88
|
-
this.server = this.apolloService.get("server1");
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
70
|
For more information about ApolloServer look his documentation [here](https://www.apollographql.com/docs/apollo-server/api/apollo-server.html);
|
|
94
71
|
|
|
95
72
|
## Contributors
|
package/vitest.config.mts
CHANGED
|
@@ -10,12 +10,12 @@ export default defineConfig(
|
|
|
10
10
|
coverage: {
|
|
11
11
|
...presets.test.coverage,
|
|
12
12
|
thresholds: {
|
|
13
|
-
statements:
|
|
14
|
-
branches:
|
|
15
|
-
functions:
|
|
16
|
-
lines:
|
|
13
|
+
statements: 81.52,
|
|
14
|
+
branches: 81.81,
|
|
15
|
+
functions: 94.73,
|
|
16
|
+
lines: 81.52
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
);
|
|
21
|
+
);
|
package/.nycrc
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"include": [
|
|
3
|
-
"src/**/*.ts"
|
|
4
|
-
],
|
|
5
|
-
"exclude": [
|
|
6
|
-
"**/*.d.ts",
|
|
7
|
-
"node_modules",
|
|
8
|
-
"**/interfaces/**",
|
|
9
|
-
"**/index.ts"
|
|
10
|
-
],
|
|
11
|
-
"extension": [
|
|
12
|
-
".ts"
|
|
13
|
-
],
|
|
14
|
-
"require": [],
|
|
15
|
-
"reporter": [
|
|
16
|
-
"text-summary",
|
|
17
|
-
"html",
|
|
18
|
-
"lcov",
|
|
19
|
-
"json"
|
|
20
|
-
],
|
|
21
|
-
"check-coverage": true,
|
|
22
|
-
"statements": 100,
|
|
23
|
-
"branches": 76.74,
|
|
24
|
-
"functions": 100,
|
|
25
|
-
"lines": 100
|
|
26
|
-
}
|