@tsed/apollo 8.0.0-alpha.3 → 8.0.0-alpha.5

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.
Files changed (64) hide show
  1. package/lib/cjs/ApolloModule.js +12 -7
  2. package/lib/cjs/ApolloModule.js.map +1 -1
  3. package/lib/cjs/constants/constants.js +2 -1
  4. package/lib/cjs/constants/constants.js.map +1 -1
  5. package/lib/cjs/decorators/dataSource.js +2 -2
  6. package/lib/cjs/decorators/injectApolloContext.js +23 -0
  7. package/lib/cjs/decorators/injectApolloContext.js.map +1 -0
  8. package/lib/cjs/index.js +5 -0
  9. package/lib/cjs/index.js.map +1 -1
  10. package/lib/cjs/interfaces/AlterApolloContext.js +3 -0
  11. package/lib/cjs/interfaces/AlterApolloContext.js.map +1 -0
  12. package/lib/cjs/interfaces/AlterApolloServerPlugins.js +3 -0
  13. package/lib/cjs/interfaces/AlterApolloServerPlugins.js.map +1 -0
  14. package/lib/cjs/interfaces/AlterApolloSettings.js +3 -0
  15. package/lib/cjs/interfaces/AlterApolloSettings.js.map +1 -0
  16. package/lib/cjs/interfaces/ApolloContext.js +3 -0
  17. package/lib/cjs/interfaces/ApolloContext.js.map +1 -0
  18. package/lib/cjs/services/ApolloService.js +73 -53
  19. package/lib/cjs/services/ApolloService.js.map +1 -1
  20. package/lib/esm/ApolloModule.js +13 -8
  21. package/lib/esm/ApolloModule.js.map +1 -1
  22. package/lib/esm/constants/constants.js +1 -0
  23. package/lib/esm/constants/constants.js.map +1 -1
  24. package/lib/esm/decorators/dataSource.js +2 -2
  25. package/lib/esm/decorators/injectApolloContext.js +19 -0
  26. package/lib/esm/decorators/injectApolloContext.js.map +1 -0
  27. package/lib/esm/index.js +5 -0
  28. package/lib/esm/index.js.map +1 -1
  29. package/lib/esm/interfaces/AlterApolloContext.js +2 -0
  30. package/lib/esm/interfaces/AlterApolloContext.js.map +1 -0
  31. package/lib/esm/interfaces/AlterApolloServerPlugins.js +2 -0
  32. package/lib/esm/interfaces/AlterApolloServerPlugins.js.map +1 -0
  33. package/lib/esm/interfaces/AlterApolloSettings.js +2 -0
  34. package/lib/esm/interfaces/AlterApolloSettings.js.map +1 -0
  35. package/lib/esm/interfaces/ApolloContext.js +2 -0
  36. package/lib/esm/interfaces/ApolloContext.js.map +1 -0
  37. package/lib/esm/services/ApolloService.js +73 -53
  38. package/lib/esm/services/ApolloService.js.map +1 -1
  39. package/lib/types/ApolloModule.d.ts +3 -2
  40. package/lib/types/constants/constants.d.ts +1 -0
  41. package/lib/types/decorators/dataSource.d.ts +2 -2
  42. package/lib/types/decorators/injectApolloContext.d.ts +5 -0
  43. package/lib/types/index.d.ts +5 -0
  44. package/lib/types/interfaces/AlterApolloContext.d.ts +5 -0
  45. package/lib/types/interfaces/AlterApolloServerPlugins.d.ts +5 -0
  46. package/lib/types/interfaces/AlterApolloSettings.d.ts +7 -0
  47. package/lib/types/interfaces/ApolloContext.d.ts +4 -0
  48. package/lib/types/interfaces/ApolloSettings.d.ts +22 -10
  49. package/lib/types/services/ApolloService.d.ts +18 -14
  50. package/lib/types-esm/ApolloModule.d.ts +3 -2
  51. package/lib/types-esm/constants/constants.d.ts +1 -0
  52. package/lib/types-esm/decorators/dataSource.d.ts +2 -2
  53. package/lib/types-esm/decorators/injectApolloContext.d.ts +5 -0
  54. package/lib/types-esm/index.d.ts +5 -0
  55. package/lib/types-esm/interfaces/AlterApolloContext.d.ts +5 -0
  56. package/lib/types-esm/interfaces/AlterApolloServerPlugins.d.ts +5 -0
  57. package/lib/types-esm/interfaces/AlterApolloSettings.d.ts +7 -0
  58. package/lib/types-esm/interfaces/ApolloContext.d.ts +4 -0
  59. package/lib/types-esm/interfaces/ApolloSettings.d.ts +22 -10
  60. package/lib/types-esm/services/ApolloService.d.ts +18 -14
  61. package/package.json +17 -21
  62. package/readme.md +1 -24
  63. package/vitest.config.mts +4 -4
  64. 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": "8.0.0-alpha.3",
5
+ "version": "8.0.0-alpha.5",
6
6
  "source": "./src/index.ts",
7
7
  "main": "./lib/cjs/index.js",
8
8
  "module": "./lib/esm/index.js",
@@ -26,33 +26,29 @@
26
26
  "tslib": "2.6.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@tsed/barrels": "8.0.0-alpha.3",
30
- "@tsed/common": "8.0.0-alpha.3",
31
- "@tsed/core": "8.0.0-alpha.3",
32
- "@tsed/di": "8.0.0-alpha.3",
29
+ "@apollo/datasource-rest": "6.2.2",
30
+ "@apollo/server": "^4.10.4",
31
+ "@as-integrations/koa": "1.1.1",
32
+ "@tsed/barrels": "8.0.0-alpha.5",
33
+ "@tsed/common": "8.0.0-alpha.5",
34
+ "@tsed/core": "8.0.0-alpha.5",
35
+ "@tsed/di": "8.0.0-alpha.5",
33
36
  "@tsed/logger": ">=6.7.5",
34
- "@tsed/typescript": "8.0.0-alpha.3",
35
- "@types/graphql": "14.5.0",
36
- "apollo-datasource": "^3.3.2",
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": "8.0.0-alpha.5",
38
+ "apollo-datasource-http": "0.21.0",
39
+ "apollo-server-testing": "2.25.3",
42
40
  "eslint": "^8.57.0",
43
- "graphql": "15.8.0",
41
+ "graphql": "16.8.2",
44
42
  "typescript": "4.9.5",
45
43
  "vitest": "2.0.4"
46
44
  },
47
45
  "peerDependencies": {
48
- "@tsed/common": "8.0.0-alpha.3",
49
- "@tsed/core": "8.0.0-alpha.3",
50
- "@tsed/di": "8.0.0-alpha.3",
46
+ "@apollo/server": ">=4.10.4",
47
+ "@tsed/common": "8.0.0-alpha.5",
48
+ "@tsed/core": "8.0.0-alpha.5",
49
+ "@tsed/di": "8.0.0-alpha.5",
51
50
  "@tsed/logger": ">=6.7.5",
52
- "apollo-datasource": ">=3.0.0",
53
- "apollo-datasource-rest": ">=3.0.0",
54
- "apollo-server-core": ">=3.0.0",
55
- "graphql": ">15.0.0"
51
+ "graphql": ">16.0.0"
56
52
  },
57
53
  "repository": "https://github.com/tsedio/tsed",
58
54
  "bugs": {
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,10 +10,10 @@ export default defineConfig(
10
10
  coverage: {
11
11
  ...presets.test.coverage,
12
12
  thresholds: {
13
- statements: 71.95,
14
- branches: 74.07,
15
- functions: 91.66,
16
- lines: 71.95
13
+ statements: 80.91,
14
+ branches: 80.95,
15
+ functions: 94.11,
16
+ lines: 80.91
17
17
  }
18
18
  }
19
19
  }
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
- }